From 7c54dbc61ff3a6643b3ea9952477fd4dac3a6051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk=20IRMAK?= Date: Wed, 28 May 2025 10:33:03 +0300 Subject: [PATCH] metrics: flesh out some of the metric types --- src/runtime/metrics/metrics.go | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/runtime/metrics/metrics.go b/src/runtime/metrics/metrics.go index 00108f84d..2b46524c1 100644 --- a/src/runtime/metrics/metrics.go +++ b/src/runtime/metrics/metrics.go @@ -2,15 +2,26 @@ package metrics -type Description struct{} +type Description struct { + Name string + Description string + Kind ValueKind + Cumulative bool +} func All() []Description { return nil } -type Float64Histogram struct{} +type Float64Histogram struct { + Counts []uint64 + Buckets []float64 +} -type Sample struct{} +type Sample struct { + Name string + Value Value +} func Read(m []Sample) {} @@ -23,10 +34,17 @@ func (v Value) Float64Histogram() *Float64Histogram { return nil } func (v Value) Kind() ValueKind { - return ValueKind{} + return KindBad } func (v Value) Uint64() uint64 { return 0 } -type ValueKind struct{} +type ValueKind int + +const ( + KindBad ValueKind = iota + KindUint64 + KindFloat64 + KindFloat64Histogram +)