* No need to *1000
authorAaron Schulz <aaron@users.mediawiki.org>
Tue, 29 Apr 2008 15:42:51 +0000 (15:42 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Tue, 29 Apr 2008 15:42:51 +0000 (15:42 +0000)
* Hide div-by-zero messages
* Fix kb factor

includes/Profiler.php
profileinfo.php

index 6ac42c6..c0fedfc 100644 (file)
@@ -271,7 +271,7 @@ class Profiler {
 
                        global $wgProfileToDatabase;
                        if ($wgProfileToDatabase) {
-                               Profiler :: logToDB($fname, (float) ($elapsed * 1000), $calls, (float) ($memory * 1000) );
+                               Profiler :: logToDB($fname, (float) ($elapsed * 1000), $calls, (float) ($memory) );
                        }
                }
                $prof .= "\nTotal: $total\n\n";
index e330a6e..ab28785 100644 (file)
@@ -124,14 +124,14 @@ class profile_point {
                <td class="name" style="padding-left: <?php echo $indent ?>em">
                        <?php echo htmlspecialchars($this->name()) . $extet ?>
                </td>
-               <td class="timep"><?php echo wfPercent( $this->time() / $totaltime * 100 ) ?></td>
-               <td class="memoryp"><?php echo wfPercent( $this->memory() / $totalmemory * 100 ) ?></td>
+               <td class="timep"><?php echo @wfPercent( $this->time() / $totaltime * 100 ) ?></td>
+               <td class="memoryp"><?php echo @wfPercent( $this->memory() / $totalmemory * 100 ) ?></td>
                <td class="count"><?php echo $this->count() ?></td>
                <td class="cpr"><?php echo round( sprintf( '%.2f', $this->callsPerRequest() ), 2 ) ?></td>
                <td class="tpc"><?php echo round( sprintf( '%.2f', $this->timePerCall() ), 2 ) ?></td>
-               <td class="mpc"><?php echo round( sprintf( '%.2f' ,$this->memoryPerCall() / 1048576 ), 2 ) ?></td>
-               <td class="tpr"><?php echo round( sprintf( '%.2f', $this->time() / $totalcount ), 2 ) ?></td>
-               <td class="mpr"><?php echo round( sprintf( '%.2f' ,$this->memory() / $totalcount / 1048576 ), 2 ) ?></td>
+               <td class="mpc"><?php echo round( sprintf( '%.2f' ,$this->memoryPerCall() / 1024 ), 2 ) ?></td>
+               <td class="tpr"><?php echo @round( sprintf( '%.2f', $this->time() / $totalcount ), 2 ) ?></td>
+               <td class="mpr"><?php echo @round( sprintf( '%.2f' ,$this->memory() / $totalcount / 1024 ), 2 ) ?></td>
                </tr>
                <?php
                if ($ex)
@@ -308,7 +308,7 @@ foreach ($points as $point) {
 </table>
 
 <p>Total time: <tt><?php printf("%5.02f", $totaltime) ?></tt></p>
-<p>Total memory: <tt><?php printf("%5.02f", $totalmemory / 1048576 ) ?></tt></p>
+<p>Total memory: <tt><?php printf("%5.02f", $totalmemory / 1024 ) ?></tt></p>
 <?php
 
 mysql_free_result($res);