summaryrefslogtreecommitdiff
path: root/internal/flamegraph/counter.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-03-29 11:25:27 +0200
committerPaul Buetow <paul@buetow.org>2025-03-29 11:25:27 +0200
commit8a34be1f4fffca90d74e2092c7bc5a6af02392c4 (patch)
treef003dc1b8d95a31bf8d01c786e98a5a622ac43cd /internal/flamegraph/counter.go
parent5f1b3be8ac4013ac7cf5041de339317defeb75ce (diff)
fix
Diffstat (limited to 'internal/flamegraph/counter.go')
-rw-r--r--internal/flamegraph/counter.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/flamegraph/counter.go b/internal/flamegraph/counter.go
new file mode 100644
index 0000000..4a63f50
--- /dev/null
+++ b/internal/flamegraph/counter.go
@@ -0,0 +1,14 @@
+package flamegraph
+
+type counter struct {
+ count uint64
+ duration uint64
+ durationToPrev uint64
+}
+
+func (c counter) add(other counter) counter {
+ c.count += other.count
+ c.duration += other.duration
+ c.durationToPrev += other.durationToPrev
+ return c
+}