RegisterInt64Count 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)
| 229 | // an init() function), and is not thread-safe. If multiple metrics are |
| 230 | // registered with the same name, this function will panic. |
| 231 | func RegisterInt64Count(descriptor MetricDescriptor) *Int64CountHandle { |
| 232 | registerMetric(descriptor.Name, descriptor.Default) |
| 233 | descriptor.Type = MetricTypeIntCount |
| 234 | descPtr := &descriptor |
| 235 | metricsRegistry[descriptor.Name] = descPtr |
| 236 | return (*Int64CountHandle)(descPtr) |
| 237 | } |
| 238 | |
| 239 | // RegisterFloat64Count registers the metric description onto the global |
| 240 | // registry. It returns a typed handle to use to recording data. |