X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Flibs%2FXhprof.php;h=5ed67c7323b254bf3d3ed2a2199d483eca48dd32;hb=ad275af1b3efaba08dba9629c94b7e1688ff0b12;hp=990e2c30533be49547baa040591a4b58613cc81c;hpb=5bd2a0a7f591f97acbe6cf73ad6d703ea8cca670;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/Xhprof.php b/includes/libs/Xhprof.php index 990e2c3053..5ed67c7323 100644 --- a/includes/libs/Xhprof.php +++ b/includes/libs/Xhprof.php @@ -267,13 +267,16 @@ class Xhprof { foreach ( $stats as $name => $value ) { if ( $value instanceof RunningStat ) { $total = $value->m1 * $value->n; + $percent = ( isset( $main[$name] ) && $main[$name] ) + ? 100 * $total / $main[$name] + : 0; $this->inclusive[$func][$name] = array( 'total' => $total, 'min' => $value->min, 'mean' => $value->m1, 'max' => $value->max, 'variance' => $value->m2, - 'percent' => 100 * $total / $main[$name], + 'percent' => $percent, ); } } @@ -318,7 +321,7 @@ class Xhprof { $this->complete[$func]['subcalls'] = array(); } - foreach( $this->hieraData as $key => $stats ) { + foreach ( $this->hieraData as $key => $stats ) { list( $parent, $child ) = self::splitKey( $key ); if ( $parent !== null ) { // Track call tree information