MCPcopy Create free account
hub / github.com/dispatchrun/wzprof / assertStackCount

Function assertStackCount

cpu_test.go:103–114  ·  view source on GitHub ↗
(t *testing.T, counts stackCounterMap, trace stackTrace, count, total int64)

Source from the content-addressed store, hash-verified

101}
102
103func assertStackCount(t *testing.T, counts stackCounterMap, trace stackTrace, count, total int64) {
104 t.Helper()
105 c := counts.lookup(trace)
106
107 if c.count() != count {
108 t.Errorf("%sstack count mismatch: want=%d got=%d", trace, count, c.count())
109 }
110
111 if c.total() != total {
112 t.Errorf("%sstack total mismatch: want=%d got=%d", trace, total, c.total())
113 }
114}
115
116func makeStackTraceFromFrames(stackFrames []experimental.StackFrame) stackTrace {
117 return makeStackTrace(stackTrace{}, experimental.NewStackIterator(stackFrames...))

Callers 1

TestCPUProfilerTimeFunction · 0.85

Calls 3

lookupMethod · 0.80
countMethod · 0.80
totalMethod · 0.80

Tested by

no test coverage detected