MCPcopy Create free account
hub / github.com/google/pprof / checkWidth

Function checkWidth

browsertests/testdata/testflame.js:56–64  ·  view source on GitHub ↗
(t, fraction)

Source from the content-addressed store, hash-verified

54 // checkWidth checks that the width of the box with text t is approximately
55 // the specified fraction of the total width.
56 function checkWidth(t, fraction) {
57 test.setContext("checkWidth", t, fraction);
58 const r = rect(t);
59 if (!r) return;
60 const expect = (chartRect.width - 2*PADDING) * fraction;
61 if (r.width < expect*0.95 || r.width > expect*1.05) {
62 test.err("bad width", r.width, "expecting ~", expect);
63 }
64 }
65
66 // Fake profile has the following stacks:
67 // 100 F1 F2 F3

Callers 1

TestFlameFunction · 0.85

Calls 3

rectFunction · 0.85
setContextMethod · 0.80
errMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…