From 283b606c0919e03209872b2c1febd8b9cc74b401 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Mon, 23 Feb 2026 18:14:04 +0100 Subject: [PATCH] Update system status activity widget periodically Adds a bit of javascript that requests the performance stats every 5 seconds. Project......: Performance Profiling Sponsored-by.: NLnet NGI0 Commons Fund --- Zotlabs/Module/Perfstats.php | 14 +++++--------- view/tpl/system_status_widget.tpl | 27 +++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/Zotlabs/Module/Perfstats.php b/Zotlabs/Module/Perfstats.php index 1de1088cc..f5e6b50e5 100644 --- a/Zotlabs/Module/Perfstats.php +++ b/Zotlabs/Module/Perfstats.php @@ -25,19 +25,15 @@ class Perfstats extends Controller $stats = []; if (function_exists('sys_getloadavg')) { - $stats['System load'] = implode(' / ', sys_getloadavg()); + $stats['loadavg'] = implode(' / ', sys_getloadavg()); } - - // Get number of queries. - // select sum(xact_commit + xact_rollback) from pg_stat_database where datname='db'; - - $stats['Queries'] = $this->getNumQueries(); - $stats['Output queue'] = Queue::get_undelivered(); + $stats['dbqueries'] = $this->getNumQueries(); + $stats['outqueue'] = Queue::get_undelivered(); $qwstats = new QueueWorkerStats(); - $stats['Queue workers'] = $qwstats->active; - $stats['Worker queue size'] = $qwstats->size; + $stats['queueworkers'] = $qwstats->active; + $stats['workqsz'] = $qwstats->size; return $stats; } diff --git a/view/tpl/system_status_widget.tpl b/view/tpl/system_status_widget.tpl index 057ec3866..2182c1974 100644 --- a/view/tpl/system_status_widget.tpl +++ b/view/tpl/system_status_widget.tpl @@ -1,15 +1,34 @@
- {{$label}} + {{$label|escape}}
- {{foreach $items as $title => $item}} + {{foreach $items as $id => $item}} - - + + {{/foreach}}
{{$title}}:{{$item}}{{$id|escape}}:{{$item|escape}}
+