Method
Collect
(ctx context.Context, networkStats map[netlogtype.Connection]netlogtype.Counts)
Source from the content-addressed store, hash-verified
| 169 | } |
| 170 | |
| 171 | func (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 | |
| 188 | func newFakeCollector(t testing.TB) *fakeCollector { |
| 189 | return &fakeCollector{ |
Callers
nothing calls this directly
Tested by
no test coverage detected