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

Method numericNodelets

internal/graph/dotgraph.go:265–282  ·  view source on GitHub ↗
(nts []*Tag, maxNumNodelets int, flatTags bool, source string)

Source from the content-addressed store, hash-verified

263}
264
265func (b *builder) numericNodelets(nts []*Tag, maxNumNodelets int, flatTags bool, source string) string {
266 nodelets := ""
267
268 // Collapse numeric labels into maxNumNodelets buckets, of the form:
269 // 1MB..2MB, 3MB..5MB, ...
270 for j, t := range b.collapsedTags(nts, maxNumNodelets, flatTags) {
271 w, attr := t.CumValue(), ` style="dotted"`
272 if flatTags || t.FlatValue() == t.CumValue() {
273 w, attr = t.FlatValue(), ""
274 }
275 if w != 0 {
276 weight := b.config.FormatValue(w)
277 nodelets += fmt.Sprintf(`N%s_%d [label = "%s" id="N%s_%d" fontsize=8 shape=box3d tooltip="%s"]`+"\n", source, j, t.Name, source, j, weight)
278 nodelets += fmt.Sprintf(`%s -> N%s_%d [label=" %s" weight=100 tooltip="%s" labeltooltip="%s"%s]`+"\n", source, source, j, weight, weight, weight, attr)
279 }
280 }
281 return nodelets
282}
283
284// addEdge generates a graph edge in DOT format.
285func (b *builder) addEdge(edge *Edge, from, to int, hasNodelets bool) {

Callers 1

addNodeletsMethod · 0.95

Calls 3

collapsedTagsMethod · 0.95
CumValueMethod · 0.45
FlatValueMethod · 0.45

Tested by

no test coverage detected