From 9904a823b0eb4205ee66b38e830a2b58cba3ecbc Mon Sep 17 00:00:00 2001 From: Bryan Davis Date: Wed, 17 Dec 2014 17:48:58 -0700 Subject: [PATCH] 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 --- includes/profiler/ProfilerXhprof.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/profiler/ProfilerXhprof.php b/includes/profiler/ProfilerXhprof.php index 162ec00653..e466657496 100644 --- a/includes/profiler/ProfilerXhprof.php +++ b/includes/profiler/ProfilerXhprof.php @@ -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; -- 2.20.1