Skip to content

Commit 7c54dbc

Browse files
omerfirmakdeadprogram
authored andcommitted
metrics: flesh out some of the metric types
1 parent 1976d9e commit 7c54dbc

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

src/runtime/metrics/metrics.go

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,26 @@
22

33
package metrics
44

5-
type Description struct{}
5+
type Description struct {
6+
Name string
7+
Description string
8+
Kind ValueKind
9+
Cumulative bool
10+
}
611

712
func All() []Description {
813
return nil
914
}
1015

11-
type Float64Histogram struct{}
16+
type Float64Histogram struct {
17+
Counts []uint64
18+
Buckets []float64
19+
}
1220

13-
type Sample struct{}
21+
type Sample struct {
22+
Name string
23+
Value Value
24+
}
1425

1526
func Read(m []Sample) {}
1627

@@ -23,10 +34,17 @@ func (v Value) Float64Histogram() *Float64Histogram {
2334
return nil
2435
}
2536
func (v Value) Kind() ValueKind {
26-
return ValueKind{}
37+
return KindBad
2738
}
2839
func (v Value) Uint64() uint64 {
2940
return 0
3041
}
3142

32-
type ValueKind struct{}
43+
type ValueKind int
44+
45+
const (
46+
KindBad ValueKind = iota
47+
KindUint64
48+
KindFloat64
49+
KindFloat64Histogram
50+
)

0 commit comments

Comments
 (0)