xhprof: discard section profiler running totals
authorBryan Davis <bd808@wikimedia.org>
Thu, 18 Dec 2014 00:48:58 +0000 (17:48 -0700)
committerBryan Davis <bd808@wikimedia.org>
Thu, 18 Dec 2014 00:52:06 +0000 (17:52 -0700)
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

index 162ec00..e466657 100644 (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;