Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ type runtimeStats struct {
// Garbage collector statistics.
nextGC Gauge // next collection will happen when HeapAlloc ≥ this amount
lastGC Gauge // end time of last collection (nanoseconds since 1970)
pauseTotalNs Counter
numGC Counter
pauseTotalNs Gauge
numGC Gauge
gcCPUPercent Gauge

numGoroutine Gauge
Expand All @@ -50,8 +50,8 @@ func NewRuntimeStats(scope Scope) StatGenerator {

nextGC: scope.NewGauge("nextGC"),
lastGC: scope.NewGauge("lastGC"),
pauseTotalNs: scope.NewCounter("pauseTotalNs"),
numGC: scope.NewCounter("numGC"),
pauseTotalNs: scope.NewGauge("pauseTotalNs"),
Copy link
Copy Markdown

@abhinavdahiya abhinavdahiya May 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://cs.opensource.google/go/go/+/refs/tags/go1.24.3:src/runtime/mstats.go;l=258-263

// PauseTotalNs is the cumulative nanoseconds in GC
// stop-the-world pauses since the program started

so pauseTotalNs is not a gauge, it is actually a counter

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I think we were looking at one of the broken charts wrong and the reason it was broken I gave more context in the thread https://lyft.slack.com/archives/C0KLXB3KN/p1747250876491629 and updated the doc

numGC: scope.NewGauge("numGC"),
gcCPUPercent: scope.NewGauge("gcCPUPercent"),

numGoroutine: scope.NewGauge("numGoroutine"),
Expand Down
Loading