RegisterFloat64Count 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)
| 243 | // an init() function), and is not thread-safe. If multiple metrics are |
| 244 | // registered with the same name, this function will panic. |
| 245 | func RegisterFloat64Count(descriptor MetricDescriptor) *Float64CountHandle { |
| 246 | registerMetric(descriptor.Name, descriptor.Default) |
| 247 | descriptor.Type = MetricTypeFloatCount |
| 248 | descPtr := &descriptor |
| 249 | metricsRegistry[descriptor.Name] = descPtr |
| 250 | return (*Float64CountHandle)(descPtr) |
| 251 | } |
| 252 | |
| 253 | // RegisterInt64Histo registers the metric description onto the global registry. |
| 254 | // It returns a typed handle to use to recording data. |