summaryrefslogtreecommitdiff
path: root/internal/flamegraph/counter.go
diff options
context:
space:
mode:
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
+}