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

Function RegisterInt64Count

experimental/stats/metricregistry.go:231–237  ·  view source on GitHub ↗

RegisterInt64Count 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

229// an init() function), and is not thread-safe. If multiple metrics are
230// registered with the same name, this function will panic.
231func RegisterInt64Count(descriptor MetricDescriptor) *Int64CountHandle {
232 registerMetric(descriptor.Name, descriptor.Default)
233 descriptor.Type = MetricTypeIntCount
234 descPtr := &descriptor
235 metricsRegistry[descriptor.Name] = descPtr
236 return (*Int64CountHandle)(descPtr)
237}
238
239// RegisterFloat64Count registers the metric description onto the global
240// registry. It returns a typed handle to use to recording data.

Callers 3

TestPanicMethod · 0.85
TestMetricRegistryMethod · 0.85
TestNumerousIntCountsMethod · 0.85

Calls 1

registerMetricFunction · 0.85

Tested by 3

TestPanicMethod · 0.68
TestMetricRegistryMethod · 0.68
TestNumerousIntCountsMethod · 0.68