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