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

Method SetConnStatsCallback

agent/stats_internal_test.go:144–154  ·  view source on GitHub ↗
(maxPeriod time.Duration, _ int, dump func(start time.Time, end time.Time, virtual map[netlogtype.Connection]netlogtype.Counts, physical map[netlogtype.Connection]netlogtype.Counts))

Source from the content-addressed store, hash-verified

142}
143
144func (f *fakeNetworkStatsSource) SetConnStatsCallback(maxPeriod time.Duration, _ int, dump func(start time.Time, end time.Time, virtual map[netlogtype.Connection]netlogtype.Counts, physical map[netlogtype.Connection]netlogtype.Counts)) {
145 f.Lock()
146 defer f.Unlock()
147 f.callback = dump
148 select {
149 case <-f.ctx.Done():
150 f.t.Error("timeout")
151 case f.period <- maxPeriod:
152 // OK
153 }
154}
155
156func newFakeNetworkStatsSource(ctx context.Context, t testing.TB) *fakeNetworkStatsSource {
157 f := &fakeNetworkStatsSource{

Callers

nothing calls this directly

Calls 4

LockMethod · 0.45
UnlockMethod · 0.45
DoneMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected