xhprof: discard section profiler running totals

The '-total' record from the section profiler used for measuring
sub-function timing is not useful in the cumulative xhprof report data.

Change-Id: Ieb79b0e82e0bed54653fab016c133cc74ec4f637
This commit is contained in:
Bryan Davis 2014-12-17 17:48:58 -07:00
parent 4449c9bcfa
commit 9904a823b0

View file

@ -139,6 +139,11 @@ class ProfilerXhprof extends Profiler {
// Merge in all of the custom profile sections
foreach ( $this->sprofiler->getFunctionStats() as $stats ) {
if ( $stats['name'] === '-total' ) {
// Discard section profiler running totals
continue;
}
// @note: getFunctionStats() values already in ms
$stats['%real'] = $stats['real'] / $main['real'] * 100;
$stats['%cpu'] = $main['cpu'] ? $stats['cpu'] / $main['cpu'] * 100 : 0;