summaryrefslogtreecommitdiff
path: root/internal/statsengine
diff options
context:
space:
mode:
Diffstat (limited to 'internal/statsengine')
-rw-r--r--internal/statsengine/filerank.go13
-rw-r--r--internal/statsengine/process.go13
-rw-r--r--internal/statsengine/snapshot.go21
-rw-r--r--internal/statsengine/syscall.go25
4 files changed, 39 insertions, 33 deletions
diff --git a/internal/statsengine/filerank.go b/internal/statsengine/filerank.go
index d24ab93..ef43c6e 100644
--- a/internal/statsengine/filerank.go
+++ b/internal/statsengine/filerank.go
@@ -191,12 +191,13 @@ func (s fileSnapshotInput) toSnapshot() FileSnapshot {
}
return FileSnapshot{
- Path: s.path,
- Accesses: s.accesses,
- BytesRead: s.bytesRead,
- BytesWritten: s.bytesWritten,
- AvgLatencyNs: avg,
- MaxLatencyNs: s.maxLatency,
+ Path: s.path,
+ Accesses: s.accesses,
+ BytesRead: s.bytesRead,
+ BytesWritten: s.bytesWritten,
+ AvgLatencyNs: avg,
+ MaxLatencyNs: s.maxLatency,
+ TotalLatencyNs: s.totalLatency,
}
}
diff --git a/internal/statsengine/process.go b/internal/statsengine/process.go
index 3bfd019..b7eb6e7 100644
--- a/internal/statsengine/process.go
+++ b/internal/statsengine/process.go
@@ -174,11 +174,12 @@ func (s processSnapshotInput) toSnapshot(rateDiv float64) ProcessSnapshot {
}
return ProcessSnapshot{
- PID: s.pid,
- Comm: s.comm,
- Syscalls: s.count,
- RatePerSec: safeRate(s.count, rateDiv),
- Bytes: s.totalBytes,
- AvgLatencyNs: avg,
+ PID: s.pid,
+ Comm: s.comm,
+ Syscalls: s.count,
+ RatePerSec: safeRate(s.count, rateDiv),
+ Bytes: s.totalBytes,
+ AvgLatencyNs: avg,
+ TotalLatencyNs: s.totalLatency,
}
}
diff --git a/internal/statsengine/snapshot.go b/internal/statsengine/snapshot.go
index f2b617b..7a95ab8 100644
--- a/internal/statsengine/snapshot.go
+++ b/internal/statsengine/snapshot.go
@@ -68,12 +68,13 @@ type SyscallSnapshot struct {
Errors uint64
Bytes uint64
- LatencyMinNs uint64
- LatencyMaxNs uint64
- LatencyMeanNs float64
- LatencyP50Ns uint64
- LatencyP95Ns uint64
- LatencyP99Ns uint64
+ LatencyMinNs uint64
+ LatencyMaxNs uint64
+ LatencyMeanNs float64
+ TotalLatencyNs uint64
+ LatencyP50Ns uint64
+ LatencyP95Ns uint64
+ LatencyP99Ns uint64
}
// FileSnapshot is an aggregated per-file ranking entry.
@@ -84,8 +85,9 @@ type FileSnapshot struct {
BytesRead uint64
BytesWritten uint64
- AvgLatencyNs float64
- MaxLatencyNs uint64
+ AvgLatencyNs float64
+ MaxLatencyNs uint64
+ TotalLatencyNs uint64
}
// ProcessSnapshot is an aggregated per-process entry.
@@ -97,7 +99,8 @@ type ProcessSnapshot struct {
RatePerSec float64
Bytes uint64
- AvgLatencyNs float64
+ AvgLatencyNs float64
+ TotalLatencyNs uint64
}
// HistogramBucketSnapshot is one bucket of a histogram snapshot.
diff --git a/internal/statsengine/syscall.go b/internal/statsengine/syscall.go
index 93931d1..2ef929a 100644
--- a/internal/statsengine/syscall.go
+++ b/internal/statsengine/syscall.go
@@ -195,18 +195,19 @@ func (s *syscallStats) ensurePercentiles() {
func (s syscallSnapshotInput) toSnapshot(rateDiv float64) SyscallSnapshot {
return SyscallSnapshot{
- TraceID: s.traceID,
- Name: s.name,
- Count: s.count,
- RatePerSec: safeRate(s.count, rateDiv),
- Errors: s.errorCount,
- Bytes: s.totalBytes,
- LatencyMinNs: s.minLatency,
- LatencyMaxNs: s.maxLatency,
- LatencyMeanNs: float64(s.totalLatency) / float64(maxU64(s.count, 1)),
- LatencyP50Ns: s.p50Latency,
- LatencyP95Ns: s.p95Latency,
- LatencyP99Ns: s.p99Latency,
+ TraceID: s.traceID,
+ Name: s.name,
+ Count: s.count,
+ RatePerSec: safeRate(s.count, rateDiv),
+ Errors: s.errorCount,
+ Bytes: s.totalBytes,
+ LatencyMinNs: s.minLatency,
+ LatencyMaxNs: s.maxLatency,
+ LatencyMeanNs: float64(s.totalLatency) / float64(maxU64(s.count, 1)),
+ TotalLatencyNs: s.totalLatency,
+ LatencyP50Ns: s.p50Latency,
+ LatencyP95Ns: s.p95Latency,
+ LatencyP99Ns: s.p99Latency,
}
}