@@ -19,18 +19,18 @@ var (
19
19
gcStats debug.GCStats
20
20
)
21
21
22
- // Capture new values for the Go garbage collector statistics exported in
23
- // debug.GCStats. This is designed to be called as a goroutine.
22
+ // CaptureDebugGCStats captures new values for the Go garbage collector statistics
23
+ // exported in debug.GCStats. This is designed to be called as a goroutine.
24
24
func CaptureDebugGCStats (r Registry , d time.Duration ) {
25
25
for range time .Tick (d ) {
26
26
CaptureDebugGCStatsOnce (r )
27
27
}
28
28
}
29
29
30
- // Capture new values for the Go garbage collector statistics exported in
31
- // debug.GCStats. This is designed to be called in a background goroutine.
32
- // Giving a registry which has not been given to RegisterDebugGCStats will
33
- // panic.
30
+ // CaptureDebugGCStatsOnce captures new values for the Go garbage collector
31
+ // statistics exported in debug.GCStats. This is designed to be called in
32
+ // a background goroutine. Giving a registry which has not been given to
33
+ // RegisterDebugGCStats will panic.
34
34
//
35
35
// Be careful (but much less so) with this because debug.ReadGCStats calls
36
36
// the C function runtime·lock(runtime·mheap) which, while not a stop-the-world
@@ -50,9 +50,9 @@ func CaptureDebugGCStatsOnce(r Registry) {
50
50
debugMetrics .GCStats .PauseTotal .Update (int64 (gcStats .PauseTotal ))
51
51
}
52
52
53
- // Register metrics for the Go garbage collector statistics exported in
54
- // debug.GCStats. The metrics are named by their fully-qualified Go symbols,
55
- // i.e. debug.GCStats.PauseTotal.
53
+ // RegisterDebugGCStats registers metrics for the Go garbage collector statistics
54
+ // exported in debug.GCStats. The metrics are named by their fully-qualified Go
55
+ // symbols, i.e. debug.GCStats.PauseTotal.
56
56
func RegisterDebugGCStats (r Registry ) {
57
57
debugMetrics .GCStats .LastGC = NewGauge ()
58
58
debugMetrics .GCStats .NumGC = NewGauge ()
0 commit comments