mirror of
https://github.com/Pathduck/gallery3.git
synced 2024-10-30 05:17:17 -04:00
Display the server load average in the platform block. Fixes ticket #198.
This commit is contained in:
parent
238cb7ff6e
commit
983dc66684
@ -64,6 +64,12 @@ class core_block_Core {
|
||||
$block->css_id = "gPlatform";
|
||||
$block->title = t("Platform Information");
|
||||
$block->content = new View("admin_block_platform.html");
|
||||
if (is_readable("/proc/loadavg")) {
|
||||
$block->content->load_average =
|
||||
join(" ", array_slice(split(" ", array_shift(file("/proc/loadavg"))), 0, 3));
|
||||
} else {
|
||||
$block->content->load_average = t("Unavailable");
|
||||
}
|
||||
break;
|
||||
|
||||
case "project_news":
|
||||
|
@ -12,4 +12,7 @@
|
||||
<li>
|
||||
<?= t("MySQL: %mysql_version", array("mysql_version" => Database::instance()->query("SELECT version() as v")->current()->v)) ?>
|
||||
</li>
|
||||
<li>
|
||||
<?= t("Server load: %load_average", array("load_average" => $load_average)) ?>
|
||||
</li>
|
||||
</ul>
|
||||
|
Loading…
Reference in New Issue
Block a user