aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-09-15 10:53:05 +1000
committerredmatrix <redmatrix@redmatrix.me>2015-09-15 10:53:05 +1000
commitdb3d99f7c73885abf38ff7f628972f025d44b98a (patch)
treeac529ef24ecd4903a0e3aa5ca22a000f32e8146e
parent8fb4f376702ad3d4417bb2c4d8937a9911cb56ca (diff)
parentdfd4115f7aca78498f8b19d58567a84d15bbfd69 (diff)
downloadvolse-hubzilla-db3d99f7c73885abf38ff7f628972f025d44b98a.tar.gz
volse-hubzilla-db3d99f7c73885abf38ff7f628972f025d44b98a.tar.bz2
volse-hubzilla-db3d99f7c73885abf38ff7f628972f025d44b98a.zip
Merge pull request #41 from redmatrix/display_load_average
Display load average on the siteinfo page
-rw-r--r--mod/siteinfo.php5
-rwxr-xr-xview/tpl/siteinfo.tpl1
2 files changed, 6 insertions, 0 deletions
diff --git a/mod/siteinfo.php b/mod/siteinfo.php
index 8281a7a0a..14aaef144 100644
--- a/mod/siteinfo.php
+++ b/mod/siteinfo.php
@@ -150,6 +150,9 @@ function siteinfo_content(&$a) {
if(file_exists('doc/site_donate.html'))
$donate .= file_get_contents('doc/site_donate.html');
+ if(function_exists('sys_getloadavg'))
+ $loadavg = sys_getloadavg();
+
$o = replace_macros(get_markup_template('siteinfo.tpl'), array(
'$title' => t('$Projectname'),
'$description' => t('This is a hub of $Projectname - a global cooperative network of decentralized privacy enhanced websites.'),
@@ -158,6 +161,8 @@ function siteinfo_content(&$a) {
'$tag' => $tag,
'$polled' => t('Last background fetch: '),
'$lastpoll' => get_poller_runtime(),
+ '$load_average' => t('Current load average: '),
+ '$loadavg_all' => $loadavg[0] . ', ' . $loadavg[1] . ', ' . $loadavg[2],
'$commit' => $commit,
'$web_location' => t('Running at web location') . ' ' . z_root(),
'$visit' => t('Please visit <a href="https://redmatrix.me">redmatrix.me</a> to learn more about $Projectname.'),
diff --git a/view/tpl/siteinfo.tpl b/view/tpl/siteinfo.tpl
index 3b0c8841c..0b16f5602 100755
--- a/view/tpl/siteinfo.tpl
+++ b/view/tpl/siteinfo.tpl
@@ -10,6 +10,7 @@
{{if $polled}}
<p>{{$polled}} {{$lastpoll}}</p>
{{/if}}
+<p>{{$load_average}} {{$loadavg_all}}</p>
<p>{{$web_location}}</p>
<p>{{$visit}}</p>
<p>{{$bug_text}} <a href="{{$bug_link_url}}">{{$bug_link_text}}</a></p>