]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13484 peak memory used perf info added
authorskodak <skodak>
Fri, 15 Feb 2008 11:32:34 +0000 (11:32 +0000)
committerskodak <skodak>
Fri, 15 Feb 2008 11:32:34 +0000 (11:32 +0000)
lib/moodlelib.php

index 580f4ea34a98d251ebc19acfb1b9751df5b19df4..b734b9d885b7850068c5cea50a017c6adc9635e8 100644 (file)
@@ -7550,6 +7550,12 @@ function get_performance_info() {
         $info['txt']  .= 'memory_total: '.$info['memory_total'].'B (' . display_size($info['memory_total']).') memory_growth: '.$info['memory_growth'].'B ('.display_size($info['memory_growth']).') ';
     }
 
+    if (function_exists('memory_get_peak_usage')) {
+        $info['memory_peak'] = memory_get_peak_usage();
+        $info['html'] .= '<span class="memoryused">RAM peak: '.display_size($info['memory_peak']).'</span> ';
+        $info['txt']  .= 'memory_peak: '.$info['memory_peak'].'B (' . display_size($info['memory_peak']).') ';
+    }
+
     $inc = get_included_files();
     //error_log(print_r($inc,1));
     $info['includecount'] = count($inc);