Metric returns the most recent data for a metric, and whether this recorder has received data for a metric.
(name string)
| 66 | // Metric returns the most recent data for a metric, and whether this recorder |
| 67 | // has received data for a metric. |
| 68 | func (r *TestMetricsRecorder) Metric(name string) (float64, bool) { |
| 69 | r.mu.Lock() |
| 70 | defer r.mu.Unlock() |
| 71 | data, ok := r.data[name] |
| 72 | return data, ok |
| 73 | } |
| 74 | |
| 75 | // ClearMetrics clears the metrics data store of the test metrics recorder. |
| 76 | func (r *TestMetricsRecorder) ClearMetrics() { |