r8109 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r8108‎ | r8109 | r8110 >
Date:11:23, 7 April 2005
Author:timstarling
Status:old
Tags:
Comment:
More format tweaks
Modified paths:
  • /branches/REL1_4/phase3/includes/Profiling.php (modified) (history)

Diff [purge]

Index: branches/REL1_4/phase3/includes/Profiling.php
@@ -177,9 +177,10 @@
178178 }
179179
180180 function getFunctionReport() {
181 - $width = 125;
182 - $format = "%-" . ($width - 34) . "s %6d %6.3f %6.3f %7.3f%% %6d (%6.3f-%6.3f) [%d]\n";
183 - $titleFormat = "%-" . ($width - 34) . "s %9s %9s %9s %9s %9s %9s %9s %9s\n";
 181+ $width = 140;
 182+ $nameWidth = $width - 65;
 183+ $format = "%-{$nameWidth}s %6d %9.3f %9.3f %9.3f%% %6d (%9.3f -%9.3f) [%d]\n";
 184+ $titleFormat = "%-{$nameWidth}s %6s %13s %13s %13s %6s %14s %14s %9s\n";
184185 $prof = "\nProfiling data\n";
185186 $prof .= sprintf( $titleFormat, 'Name', 'Calls', 'Total', 'Each', '%',
186187 'Mem', 'Min', 'Max', 'Overhead' );
@@ -264,7 +265,7 @@
265266 $calls = $this->mCalls[$fname];
266267 $percent = $total ? 100. * $elapsed / $total : 0;
267268 $memory = $this->mMemory[$fname];
268 - $prof .= sprintf( $format, substr( $fname, 0, $width-34), $calls, (float)($elapsed * 1000),
 269+ $prof .= sprintf( $format, substr( $fname, 0, $nameWidth), $calls, (float)($elapsed * 1000),
269270 (float)($elapsed * 1000) / $calls, $percent, $memory,
270271 ($this->mMin[$fname] * 1000.0),
271272 ($this->mMax[$fname] * 1000.0),

Status & tagging log