RegisterFloat64Histo 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 sa
(descriptor MetricDescriptor)
| 271 | // an init() function), and is not thread-safe. If multiple metrics are |
| 272 | // registered with the same name, this function will panic. |
| 273 | func RegisterFloat64Histo(descriptor MetricDescriptor) *Float64HistoHandle { |
| 274 | registerMetric(descriptor.Name, descriptor.Default) |
| 275 | descriptor.Type = MetricTypeFloatHisto |
| 276 | descPtr := &descriptor |
| 277 | metricsRegistry[descriptor.Name] = descPtr |
| 278 | return (*Float64HistoHandle)(descPtr) |
| 279 | } |
| 280 | |
| 281 | // RegisterInt64Gauge registers the metric description onto the global registry. |
| 282 | // It returns a typed handle to use to recording data. |