summaryrefslogtreecommitdiff
path: root/internal/statsengine/snapshot.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/statsengine/snapshot.go')
-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)