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)
| 299 | // an init() function), and is not thread-safe. If multiple metrics are |
| 300 | // registered with the same name, this function will panic. |
| 301 | func 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. |