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

Function RegisterInt64Gauge

experimental/stats/metricregistry.go:287–293  ·  view source on GitHub ↗

RegisterInt64Gauge registers the metric description onto the global registry. It returns a typed handle to use to 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 the same

(descriptor MetricDescriptor)

Source from the content-addressed store, hash-verified

285// an init() function), and is not thread-safe. If multiple metrics are
286// registered with the same name, this function will panic.
287func RegisterInt64Gauge(descriptor MetricDescriptor) *Int64GaugeHandle {
288 registerMetric(descriptor.Name, descriptor.Default)
289 descriptor.Type = MetricTypeIntGauge
290 descPtr := &descriptor
291 metricsRegistry[descriptor.Name] = descPtr
292 return (*Int64GaugeHandle)(descPtr)
293}
294
295// RegisterInt64UpDownCount registers the metric description onto the global registry.
296// It returns a typed handle to use for recording data.

Callers 2

TestPanicMethod · 0.85
TestMetricRegistryMethod · 0.85

Calls 1

registerMetricFunction · 0.85

Tested by 2

TestPanicMethod · 0.68
TestMetricRegistryMethod · 0.68