-<?
+<?php
# This file is only included if profiling is enabled
function wfProfileIn( $functionname )
{
if( !count( $this->mStack ) ) {
return "No profiling output\n";
}
+ $this->close();
$width = 125;
$format = "%-" . ($width - 28) . "s %6d %6.3f %6.3f %6.3f%%\n";
$titleFormat = "%-" . ($width - 28) . "s %9s %9s %9s %9s\n";
$end = explode( " ", $entry[3]);
$end = (float)$end[0] + (float)$end[1];
$elapsed = $end - $start;
+
+ if ( !array_key_exists( $fname, $this->mCollated ) ) {
+ $this->mCollated[$fname] = 0;
+ $this->mCalls[$fname] = 0;
+ }
+
$this->mCollated[$fname] += $elapsed;
$this->mCalls[$fname] ++;
}
- $total = $this->mCollated["-total"];
+ $total = @$this->mCollated["-total"];
$overhead = $this->mCollated["-overhead-internal"] / $profileCount;
$this->mCalls["-overhead-total"] = $profileCount;
$wgProfiler = new Profiler();
$wgProfiler->profileIn( "-total" );
-
?>