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

Function pickColor

internal/report/stacks.go:200–205  ·  view source on GitHub ↗

pickColor picks a color for key.

(key string)

Source from the content-addressed store, hash-verified

198
199// pickColor picks a color for key.
200func pickColor(key string) int {
201 const numColors = 1048576
202 h := sha256.Sum256([]byte(key))
203 index := binary.LittleEndian.Uint32(h[:])
204 return int(index % numColors)
205}
206
207// Legend returns the list of lines to display as the legend.
208func (s *StackSet) Legend() []string {

Callers 1

makeInitialStacksMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…