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

Method SortNodes

internal/graph/graph.go:828–839  ·  view source on GitHub ↗

SortNodes sorts the nodes in a graph based on a specific heuristic.

(cum bool, visualMode bool)

Source from the content-addressed store, hash-verified

826
827// SortNodes sorts the nodes in a graph based on a specific heuristic.
828func (g *Graph) SortNodes(cum bool, visualMode bool) {
829 // Sort nodes based on requested mode
830 switch {
831 case visualMode:
832 // Specialized sort to produce a more visually-interesting graph
833 g.Nodes.Sort(EntropyOrder)
834 case cum:
835 g.Nodes.Sort(CumNameOrder)
836 default:
837 g.Nodes.Sort(FlatNameOrder)
838 }
839}
840
841// SelectTopNodePtrs returns a set of the top maxNodes *Node in a graph.
842func (g *Graph) SelectTopNodePtrs(maxNodes int, visualMode bool) NodePtrSet {

Callers 1

newTrimmedGraphMethod · 0.80

Calls 1

SortMethod · 0.45

Tested by

no test coverage detected