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

Function RegisterInt64AsyncGauge

experimental/stats/metricregistry.go:316–322  ·  view source on GitHub ↗

RegisterInt64AsyncGauge registers the metric description onto the global registry. It returns a typed handle to use for recording data. NOTE: this function must only be called during initialization time (i.e. in an init() function), and is not thread-safe. If multiple metrics are registered with th

(descriptor MetricDescriptor)

Source from the content-addressed store, hash-verified

314// an init() function), and is not thread-safe. If multiple metrics are
315// registered with the same name, this function will panic.
316func RegisterInt64AsyncGauge(descriptor MetricDescriptor) *Int64AsyncGaugeHandle {
317 registerMetric(descriptor.Name, descriptor.Default)
318 descriptor.Type = MetricTypeIntAsyncGauge
319 descPtr := &descriptor
320 metricsRegistry[descriptor.Name] = descPtr
321 return (*Int64AsyncGaugeHandle)(descPtr)
322}
323
324// snapshotMetricsRegistryForTesting snapshots the global data of the metrics
325// registry. Returns a cleanup function that sets the metrics registry to its

Callers 1

TestMetricRegistryMethod · 0.85

Calls 1

registerMetricFunction · 0.85

Tested by 1

TestMetricRegistryMethod · 0.68