MCPcopy
hub / github.com/grafana/tempo / train

Method train

pkg/drain/drain.go:96–109  ·  view source on GitHub ↗
(tokens []string)

Source from the content-addressed store, hash-verified

94}
95
96func (d *Drain) train(tokens []string) *LogCluster {
97 cluster := d.findMatchingClusterForTokens(tokens)
98
99 if cluster == nil {
100 cluster = d.newCluster(tokens)
101 d.addClusterToRootNode(cluster)
102 d.metrics.PatternsDetectedTotal.Inc()
103 } else {
104 cluster.ingestTokens(tokens)
105 }
106
107 d.idToCluster.Put(cluster)
108 return cluster
109}
110
111// Prune removes old branches from the tree. We rely on the cache eviction
112// algorithm to remove clusters from the cache, then this method will remove

Callers 1

TrainMethod · 0.95

Calls 6

newClusterMethod · 0.95
addClusterToRootNodeMethod · 0.95
ingestTokensMethod · 0.80
IncMethod · 0.65
PutMethod · 0.45

Tested by

no test coverage detected