From d216a0691c57bf723bbf306f5efc52b79cf58037 Mon Sep 17 00:00:00 2001 From: Amy Gale Ruth Bowersox Date: Sat, 7 Mar 2026 14:28:15 -0700 Subject: [PATCH] finished up the system statistics page --- TODO.md | 7 ++++--- sysadmin.go | 9 +++++++++ ui/views/sysstat.jet | 20 ++++++++++---------- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/TODO.md b/TODO.md index 1a71e75..835330c 100644 --- a/TODO.md +++ b/TODO.md @@ -4,11 +4,12 @@ After the point where it reaches feature parity with Venice circa 2006. ## Pre-Launch Polish -* Policy page support. -* User agreement in a separate file rather than directly in settings. +* ~~Policy page support.~~ +* ~~User agreement in a separate file rather than directly in settings.~~ * Support all customizations that were done with the EMinds instance of Venice. -* Gitea-like status page showing Go-specific internals. +* ~~Gitea-like status page showing Go-specific internals.~~ * Build static Tailwind CSS file rather than using remote-loaded version. (Gate on debug/prod flag) +* Rate limiter. ## Immediate Cleanups Required diff --git a/sysadmin.go b/sysadmin.go index 89a0ba0..8381972 100644 --- a/sysadmin.go +++ b/sysadmin.go @@ -837,6 +837,15 @@ func SysStats(ctxt ui.AmContext) (string, any) { ctxt.VarMap().Set("memHeapIdle", humanize.IBytes(mstat.HeapIdle)) ctxt.VarMap().Set("memHeapInuse", humanize.IBytes(mstat.HeapInuse)) ctxt.VarMap().Set("memHeapReleased", humanize.IBytes(mstat.HeapReleased)) + ctxt.VarMap().Set("memStackInuse", humanize.IBytes(mstat.StackInuse)) + ctxt.VarMap().Set("memStackSys", humanize.IBytes(mstat.StackSys)) + ctxt.VarMap().Set("memMSpanInuse", humanize.IBytes(mstat.MSpanInuse)) + ctxt.VarMap().Set("memMSpanSys", humanize.IBytes(mstat.MSpanSys)) + ctxt.VarMap().Set("memMCacheInuse", humanize.IBytes(mstat.MCacheInuse)) + ctxt.VarMap().Set("memMCacheSys", humanize.IBytes(mstat.MCacheSys)) + ctxt.VarMap().Set("memBuckHashSys", humanize.IBytes(mstat.BuckHashSys)) + ctxt.VarMap().Set("memGCSys", humanize.IBytes(mstat.GCSys)) + ctxt.VarMap().Set("memOtherSys", humanize.IBytes(mstat.OtherSys)) ctxt.VarMap().Set("memLastGCTime", time.Unix(0, int64(mstat.LastGC)).Format(time.RFC3339)) ctxt.VarMap().Set("memTotalPause", fmt.Sprintf("%.3f ms", float64(mstat.PauseTotalNs)/1000/1000)) ctxt.VarMap().Set("memGCPercent", fmt.Sprintf("%.5f%%", float64(mstat.GCCPUFraction)*100)) diff --git a/ui/views/sysstat.jet b/ui/views/sysstat.jet index 88ed390..4ea9922 100644 --- a/ui/views/sysstat.jet +++ b/ui/views/sysstat.jet @@ -22,7 +22,7 @@

General Statistics

-
+
@@ -51,7 +51,7 @@

Heap Statistics

-
+
@@ -72,32 +72,32 @@

System Allocations

-
+
- + - + - + - + - + - +
Stack Usage{{ mstat.StackInuse }} in use ({{ mstat.StackSys }} from system){{ memStackInuse }} in use ({{ memStackSys }} from system)
MSpan Usage{{ mstat.MSpanInuse }} in use ({{ mstat.MSpanSys }} from system){{ memMSpanInuse }} in use ({{ memMSpanSys }} from system)
MCache Usage{{ mstat.MCacheInuse }} in use ({{ mstat.MCacheSys }} from system){{ memMCacheInuse }} in use ({{ memMCacheSys }} from system)
Bucket Hashtable Usage{{ mstat.BuckHashSys }}{{ memBuckHashSys }}
GC Usage{{ mstat.GCSys }}{{ memGCSys }}
Miscellaneous Usage{{ mstat.OtherSys }}{{ memOtherSys }}
@@ -105,7 +105,7 @@

GC Statistics

-
+