diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index f9c6870fa7c..8bdfa86a297 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -9017,30 +9017,31 @@ function get_performance_info() {
// Attempt to avoid devs debugging peformance issues, when its caused by css building and so on.
$info['html'] .= '
Warning: Theme designer mode is enabled.
';
}
- $info['html'] .= ''; // Holds userfriendly HTML representation.
+ $info['html'] .= ''; // Holds userfriendly HTML representation.
$info['realtime'] = microtime_diff($PERF->starttime, microtime());
- $info['html'] .= '- '.$info['realtime'].' secs
';
+ $info['html'] .= '- '.$info['realtime'].' secs
';
$info['txt'] .= 'time: '.$info['realtime'].'s ';
if (function_exists('memory_get_usage')) {
$info['memory_total'] = memory_get_usage();
$info['memory_growth'] = memory_get_usage() - $PERF->startmemory;
- $info['html'] .= '- RAM: '.display_size($info['memory_total']).'
';
+ $info['html'] .= '- RAM: '.display_size($info['memory_total']).'
';
$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'] .= '- RAM peak: '.display_size($info['memory_peak']).'
';
+ $info['html'] .= '- RAM peak: '.display_size($info['memory_peak']).'
';
$info['txt'] .= 'memory_peak: '.$info['memory_peak'].'B (' . display_size($info['memory_peak']).') ';
}
+ $info['html'] .= '
';
$inc = get_included_files();
$info['includecount'] = count($inc);
- $info['html'] .= '- Included '.$info['includecount'].' files
';
+ $info['html'] .= '- Included '.$info['includecount'].' files
';
$info['txt'] .= 'includecount: '.$info['includecount'].' ';
if (!empty($CFG->early_install_lang) or empty($PAGE)) {
@@ -9053,7 +9054,7 @@ function get_performance_info() {
list($filterinfo, $nicenames) = $filtermanager->get_performance_summary();
$info = array_merge($filterinfo, $info);
foreach ($filterinfo as $key => $value) {
- $info['html'] .= "- $nicenames[$key]: $value
";
+ $info['html'] .= "- $nicenames[$key]: $value
";
$info['txt'] .= "$key: $value ";
}
}
@@ -9063,23 +9064,23 @@ function get_performance_info() {
list($filterinfo, $nicenames) = $stringmanager->get_performance_summary();
$info = array_merge($filterinfo, $info);
foreach ($filterinfo as $key => $value) {
- $info['html'] .= "- $nicenames[$key]: $value
";
+ $info['html'] .= "- $nicenames[$key]: $value
";
$info['txt'] .= "$key: $value ";
}
}
if (!empty($PERF->logwrites)) {
$info['logwrites'] = $PERF->logwrites;
- $info['html'] .= '- Log DB writes '.$info['logwrites'].'
';
+ $info['html'] .= '- Log DB writes '.$info['logwrites'].'
';
$info['txt'] .= 'logwrites: '.$info['logwrites'].' ';
}
$info['dbqueries'] = $DB->perf_get_reads().'/'.($DB->perf_get_writes() - $PERF->logwrites);
- $info['html'] .= '- DB reads/writes: '.$info['dbqueries'].'
';
+ $info['html'] .= '- DB reads/writes: '.$info['dbqueries'].'
';
$info['txt'] .= 'db reads/writes: '.$info['dbqueries'].' ';
$info['dbtime'] = round($DB->perf_get_queries_time(), 5);
- $info['html'] .= '- DB queries time: '.$info['dbtime'].' secs
';
+ $info['html'] .= '- DB queries time: '.$info['dbtime'].' secs
';
$info['txt'] .= 'db queries time: ' . $info['dbtime'] . 's ';
if (function_exists('posix_times')) {
@@ -9088,7 +9089,8 @@ function get_performance_info() {
foreach ($ptimes as $key => $val) {
$info[$key] = $ptimes[$key] - $PERF->startposixtimes[$key];
}
- $info['html'] .= "- ticks: $info[ticks] user: $info[utime] sys: $info[stime] cuser: $info[cutime] csys: $info[cstime]
";
+ $info['html'] .= "- ticks: $info[ticks] user: $info[utime]";
+ $info['html'] .= "sys: $info[stime] cuser: $info[cutime] csys: $info[cstime]
";
$info['txt'] .= "ticks: $info[ticks] user: $info[utime] sys: $info[stime] cuser: $info[cutime] csys: $info[cstime] ";
}
}
@@ -9108,20 +9110,22 @@ function get_performance_info() {
}
if (!empty($serverload)) {
$info['serverload'] = $serverload;
- $info['html'] .= '- Load average: '.$info['serverload'].'
';
+ $info['html'] .= '- Load average: '.$info['serverload'].'
';
$info['txt'] .= "serverload: {$info['serverload']} ";
}
// Display size of session if session started.
if ($si = \core\session\manager::get_performance_info()) {
$info['sessionsize'] = $si['size'];
- $info['html'] .= $si['html'];
+ $info['html'] .= "- " . $si['html'] . "
";
$info['txt'] .= $si['txt'];
}
+ $info['html'] .= '
';
if ($stats = cache_helper::get_stats()) {
- $html = '';
- $html .= '- Caches used (hits/misses/sets)
';
+ $html = '';
+ $html .= '- Caches used (hits/misses/sets)
';
+ $html .= '
';
$text = 'Caches used (hits/misses/sets): ';
$hits = 0;
$misses = 0;
@@ -9141,8 +9145,9 @@ function get_performance_info() {
$mode = ' [r]';
break;
}
- $html .= '';
- $html .= '- '.$definition.$mode.'
';
+ $html .= '';
+ $html .= '';
$text .= "$definition {";
foreach ($details['stores'] as $store => $data) {
$hits += $data['hits'];
@@ -9156,7 +9161,12 @@ function get_performance_info() {
$cachestoreclass = 'hihits text-success';
}
$text .= "$store($data[hits]/$data[misses]/$data[sets]) ";
- $html .= "- $store: $data[hits] / $data[misses] / $data[sets]
";
+ $html .= "- " .
+ "$store: $data[hits] / $data[misses] / $data[sets]
";
+ // This makes boxes of same sizes.
+ if (count($details['stores']) == 1) {
+ $html .= "-
";
+ }
}
$html .= '
';
$text .= '} ';
@@ -9172,7 +9182,7 @@ function get_performance_info() {
$info['txt'] .= 'Caches used (hits/misses/sets): 0/0/0 ';
}
- $info['html'] = ''.$info['html'].'
';
+ $info['html'] = ''.$info['html'].'
';
return $info;
}
diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php
index 2fd66bc1512..977fa6984e5 100644
--- a/lib/outputrenderers.php
+++ b/lib/outputrenderers.php
@@ -716,7 +716,7 @@ class core_renderer extends renderer_base {
}
if (!empty($CFG->debugvalidators)) {
// NOTE: this is not a nice hack, $PAGE->url is not always accurate and $FULLME neither, it is not a bug if it fails. --skodak
- $output .= '