class Profiler {
var $mStack = array (), $mWorkStack = array (), $mCollated = array ();
var $mCalls = array (), $mTotals = array ();
+ var $mTemplated = false;
function __construct() {
// Push an entry for the pre-profile setup time onto the stack
}
}
+ /**
+ * Mark this call as templated or not
+ * @param $t Boolean
+ */
+ function setTemplated( $t ) {
+ $this->mTemplated = $t;
+ }
+
/**
* called by wfGetProfilingOutput()
*/
$overheadInternal[] = $elapsed;
}
}
- $overheadTotal = array_sum( $overheadTotal ) / count( $overheadInternal );
- $overheadMemory = array_sum( $overheadMemory ) / count( $overheadInternal );
- $overheadInternal = array_sum( $overheadInternal ) / count( $overheadInternal );
+ $overheadTotal = $overheadTotal ? array_sum( $overheadTotal ) / count( $overheadInternal ) : 0;
+ $overheadMemory = $overheadMemory ? array_sum( $overheadMemory ) / count( $overheadInternal ) : 0;
+ $overheadInternal = $overheadInternal ? array_sum( $overheadInternal ) / count( $overheadInternal ) : 0;
# Collate
foreach( $this->mStack as $index => $entry ){