Report implements the telemetry.Reporter interface by sending the snapshot to the snapshots channel.
(snapshot *telemetry.Snapshot)
| 3305 | // Report implements the telemetry.Reporter interface by sending the snapshot |
| 3306 | // to the snapshots channel. |
| 3307 | func (f *fakeTelemetryReporter) Report(snapshot *telemetry.Snapshot) { |
| 3308 | if !f.enabled { |
| 3309 | return |
| 3310 | } |
| 3311 | |
| 3312 | select { |
| 3313 | case f.snapshots <- snapshot: |
| 3314 | // Successfully sent |
| 3315 | case <-f.ctx.Done(): |
| 3316 | f.t.Error("context closed while writing snapshot") |
| 3317 | } |
| 3318 | } |
| 3319 | |
| 3320 | // Enabled implements the telemetry.Reporter interface. |
| 3321 | func (f *fakeTelemetryReporter) Enabled() bool { |