MCPcopy Create free account
hub / github.com/flant/shell-operator / runMetrics

Method runMetrics

pkg/shell-operator/operator.go:995–1007  ·  view source on GitHub ↗

runMetrics spawns two long-running metric goroutines. Both honor op.ctx and are tracked by op.wg so Shutdown waits for them to finish.

()

Source from the content-addressed store, hash-verified

993// runMetrics spawns two long-running metric goroutines. Both honor op.ctx and
994// are tracked by op.wg so Shutdown waits for them to finish.
995func (op *ShellOperator) runMetrics() {
996 if op.MetricStorage == nil {
997 return
998 }
999
1000 op.wg.Add(1)
1001 go op.runLiveTicks()
1002
1003 if op.TaskQueues != nil {
1004 op.wg.Add(1)
1005 go op.runQueueLengthMetric()
1006 }
1007}
1008
1009func (op *ShellOperator) runLiveTicks() {
1010 defer op.wg.Done()

Callers 1

StartMethod · 0.95

Calls 3

runLiveTicksMethod · 0.95
runQueueLengthMetricMethod · 0.95
AddMethod · 0.65

Tested by

no test coverage detected