summaryrefslogtreecommitdiff
path: root/internal/statsengine
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-24 10:35:13 +0200
committerPaul Buetow <paul@buetow.org>2026-02-24 10:35:13 +0200
commita403ca152b6268eacf2804c2d857ead16af37ef3 (patch)
tree6df1ebaa0e2a68f2dfc6c17b9987ae8fbff3129c /internal/statsengine
parent791c7aa9e573e80e90ba37e07c8791f280e74d9a (diff)
tui: address review feedback for dashboard and export
Diffstat (limited to 'internal/statsengine')
-rw-r--r--internal/statsengine/snapshot.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/statsengine/snapshot.go b/internal/statsengine/snapshot.go
index 898b7f1..6583514 100644
--- a/internal/statsengine/snapshot.go
+++ b/internal/statsengine/snapshot.go
@@ -174,16 +174,31 @@ func (s Snapshot) Syscalls() []SyscallSnapshot {
return slices.Clone(s.syscalls)
}
+// SyscallsCount returns number of syscall rows without cloning backing slices.
+func (s Snapshot) SyscallsCount() int {
+ return len(s.syscalls)
+}
+
// Files returns a defensive copy of per-file snapshot rows.
func (s Snapshot) Files() []FileSnapshot {
return slices.Clone(s.files)
}
+// FilesCount returns number of file rows without cloning backing slices.
+func (s Snapshot) FilesCount() int {
+ return len(s.files)
+}
+
// Processes returns a defensive copy of per-process snapshot rows.
func (s Snapshot) Processes() []ProcessSnapshot {
return slices.Clone(s.processes)
}
+// ProcessesCount returns number of process rows without cloning backing slices.
+func (s Snapshot) ProcessesCount() int {
+ return len(s.processes)
+}
+
// Buckets returns a defensive copy of histogram buckets.
func (h HistogramSnapshot) Buckets() []HistogramBucketSnapshot {
return slices.Clone(h.buckets)