RegisterInt64Histo 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)
| 257 | // an init() function), and is not thread-safe. If multiple metrics are |
| 258 | // registered with the same name, this function will panic. |
| 259 | func RegisterInt64Histo(descriptor MetricDescriptor) *Int64HistoHandle { |
| 260 | registerMetric(descriptor.Name, descriptor.Default) |
| 261 | descriptor.Type = MetricTypeIntHisto |
| 262 | descPtr := &descriptor |
| 263 | metricsRegistry[descriptor.Name] = descPtr |
| 264 | return (*Int64HistoHandle)(descPtr) |
| 265 | } |
| 266 | |
| 267 | // RegisterFloat64Histo registers the metric description onto the global |
| 268 | // registry. It returns a typed handle to use to recording data. |