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

Method TrimLowFrequencyEdges

internal/graph/graph.go:813–825  ·  view source on GitHub ↗

TrimLowFrequencyEdges removes edges that have less than the specified weight. Returns the number of edges removed

(edgeCutoff int64)

Source from the content-addressed store, hash-verified

811// TrimLowFrequencyEdges removes edges that have less than
812// the specified weight. Returns the number of edges removed
813func (g *Graph) TrimLowFrequencyEdges(edgeCutoff int64) int {
814 var droppedEdges int
815 for _, n := range g.Nodes {
816 for src, e := range n.In {
817 if abs64(e.Weight) < edgeCutoff {
818 delete(n.In, src)
819 delete(src.Out, n)
820 droppedEdges++
821 }
822 }
823 }
824 return droppedEdges
825}
826
827// SortNodes sorts the nodes in a graph based on a specific heuristic.
828func (g *Graph) SortNodes(cum bool, visualMode bool) {

Callers 1

newTrimmedGraphMethod · 0.80

Calls 1

abs64Function · 0.70

Tested by

no test coverage detected