From a403ca152b6268eacf2804c2d857ead16af37ef3 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 24 Feb 2026 10:35:13 +0200 Subject: tui: address review feedback for dashboard and export --- internal/statsengine/snapshot.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'internal/statsengine') 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) -- cgit v1.2.3