MCPcopy Index your code
hub / github.com/coder/coder / WithStatsChannel

Method WithStatsChannel

coderd/jobreaper/detector.go:132–135  ·  view source on GitHub ↗

WithStatsChannel will cause Executor to push a RunStats to ch after every tick. This push is blocking, so if ch is not read, the detector will hang. This should only be used in tests.

(ch chan<- Stats)

Source from the content-addressed store, hash-verified

130// every tick. This push is blocking, so if ch is not read, the detector will
131// hang. This should only be used in tests.
132func (d *Detector) WithStatsChannel(ch chan<- Stats) *Detector {
133 d.stats = ch
134 return d
135}
136
137// Start will cause the detector to detect and unhang provisioner jobs on every
138// tick from its channel. It will stop when its context is Done, or when its

Callers 2

NewOptionsFunction · 0.45
newDetectorTestEnvFunction · 0.45

Calls

no outgoing calls

Tested by 1

newDetectorTestEnvFunction · 0.36