Method
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))
Source from the content-addressed store, hash-verified
| 142 | } |
| 143 | |
| 144 | func (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 | |
| 156 | func newFakeNetworkStatsSource(ctx context.Context, t testing.TB) *fakeNetworkStatsSource { |
| 157 | f := &fakeNetworkStatsSource{ |
Callers
nothing calls this directly
Tested by
no test coverage detected