This repository was archived by the owner on Nov 9, 2017. It is now read-only.
File tree 3 files changed +7
-0
lines changed
3 files changed +7
-0
lines changed Original file line number Diff line number Diff line change 12
12
// Mem.NumGC
13
13
// Mem.PauseTotalNs
14
14
// Mem.LastGC
15
+ // Mem.NextGC
15
16
// Mem.Alloc
16
17
// Mem.HeapObjects
17
18
// Goroutines.Num
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ func init() {
15
15
metrics .Gauge ("Mem.LastGC" ).SetBatchFunc (key {}, msg .init , msg .lastPause )
16
16
metrics .Gauge ("Mem.Alloc" ).SetBatchFunc (key {}, msg .init , msg .alloc )
17
17
metrics .Gauge ("Mem.HeapObjects" ).SetBatchFunc (key {}, msg .init , msg .objects )
18
+ metrics .Gauge ("Mem.NextGC" ).SetBatchFunc (key {}, msg .init , msg .nextGC )
18
19
}
19
20
20
21
type key struct {} // unexported to prevent collision
@@ -46,3 +47,7 @@ func (msg *memStatGauges) alloc() int64 {
46
47
func (msg * memStatGauges ) objects () int64 {
47
48
return int64 (msg .stats .HeapObjects )
48
49
}
50
+
51
+ func (msg * memStatGauges ) nextGC () int64 {
52
+ return int64 (msg .stats .NextGC )
53
+ }
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ func TestMemStats(t *testing.T) {
18
18
"Mem.LastGC" ,
19
19
"Mem.Alloc" ,
20
20
"Mem.HeapObjects" ,
21
+ "Mem.NextGC" ,
21
22
}
22
23
23
24
for _ , name := range expectedCounters {
You can’t perform that action at this time.
0 commit comments