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

Method Collect

agent/stats_internal_test.go:171–186  ·  view source on GitHub ↗
(ctx context.Context, networkStats map[netlogtype.Connection]netlogtype.Counts)

Source from the content-addressed store, hash-verified

169}
170
171func (f *fakeCollector) Collect(ctx context.Context, networkStats map[netlogtype.Connection]netlogtype.Counts) *proto.Stats {
172 select {
173 case <-ctx.Done():
174 f.t.Error("timeout on collect")
175 return nil
176 case f.calls <- networkStats:
177 // ok
178 }
179 select {
180 case <-ctx.Done():
181 f.t.Error("timeout on collect")
182 return nil
183 case s := <-f.stats:
184 return s
185 }
186}
187
188func newFakeCollector(t testing.TB) *fakeCollector {
189 return &fakeCollector{

Callers

nothing calls this directly

Calls 2

DoneMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected