MCPcopy
hub / github.com/grpc/grpc-go / Metric

Method Metric

internal/testutils/stats/test_metrics_recorder.go:68–73  ·  view source on GitHub ↗

Metric returns the most recent data for a metric, and whether this recorder has received data for a metric.

(name string)

Source from the content-addressed store, hash-verified

66// Metric returns the most recent data for a metric, and whether this recorder
67// has received data for a metric.
68func (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.
76func (r *TestMetricsRecorder) ClearMetrics() {

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45