runMetrics spawns two long-running metric goroutines. Both honor op.ctx and are tracked by op.wg so Shutdown waits for them to finish.
()
| 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. |
| 995 | func (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 | |
| 1009 | func (op *ShellOperator) runLiveTicks() { |
| 1010 | defer op.wg.Done() |
no test coverage detected