X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Flibs%2FXhprof.php;h=5ed67c7323b254bf3d3ed2a2199d483eca48dd32;hb=ad275af1b3efaba08dba9629c94b7e1688ff0b12;hp=1ad01ccc9fc721a0e49aa8fef98f70712a5a14db;hpb=6ee5b825ccf3e64690e851f55905686edd39a450;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/Xhprof.php b/includes/libs/Xhprof.php index 1ad01ccc9f..5ed67c7323 100644 --- a/includes/libs/Xhprof.php +++ b/includes/libs/Xhprof.php @@ -1,6 +1,5 @@ $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, ); } } @@ -319,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