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

Function RegisterInt64UpDownCount

experimental/stats/metricregistry.go:301–308  ·  view source on GitHub ↗

RegisterInt64UpDownCount 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 t

(descriptor MetricDescriptor)

Source from the content-addressed store, hash-verified

299// an init() function), and is not thread-safe. If multiple metrics are
300// registered with the same name, this function will panic.
301func RegisterInt64UpDownCount(descriptor MetricDescriptor) *Int64UpDownCountHandle {
302 registerMetric(descriptor.Name, descriptor.Default)
303 // Set the specific metric type for the up-down counter
304 descriptor.Type = MetricTypeIntUpDownCount
305 descPtr := &descriptor
306 metricsRegistry[descriptor.Name] = descPtr
307 return (*Int64UpDownCountHandle)(descPtr)
308}
309
310// RegisterInt64AsyncGauge registers the metric description onto the global registry.
311// It returns a typed handle to use for recording data.

Callers 2

TestMetricRegistryMethod · 0.85
TestUpDownCountsMethod · 0.85

Calls 1

registerMetricFunction · 0.85

Tested by 2

TestMetricRegistryMethod · 0.68
TestUpDownCountsMethod · 0.68