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

Method runLiveTicks

pkg/shell-operator/operator.go:1009–1023  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1007}
1008
1009func (op *ShellOperator) runLiveTicks() {
1010 defer op.wg.Done()
1011 ticker := time.NewTicker(10 * time.Second)
1012 defer ticker.Stop()
1013 // Emit one tick immediately so the metric appears before the first interval.
1014 op.MetricStorage.CounterAdd(metrics.LiveTicks, 1.0, map[string]string{})
1015 for {
1016 select {
1017 case <-op.ctx.Done():
1018 return
1019 case <-ticker.C:
1020 op.MetricStorage.CounterAdd(metrics.LiveTicks, 1.0, map[string]string{})
1021 }
1022 }
1023}
1024
1025func (op *ShellOperator) runQueueLengthMetric() {
1026 defer op.wg.Done()

Callers 1

runMetricsMethod · 0.95

Calls 2

StopMethod · 0.65
CounterAddMethod · 0.45

Tested by

no test coverage detected