out.scalar = in.sysStats.gcCyclesDone
},
},
- "/gc/heap/allocs-by-size:objects": {
+ "/gc/heap/allocs-by-size:bytes": {
deps: makeStatDepSet(heapStatsDep),
compute: func(in *statAggregate, out *metricValue) {
hist := out.float64HistOrInit(sizeClassBuckets)
}
},
},
- "/gc/heap/frees-by-size:objects": {
+ "/gc/heap/frees-by-size:bytes": {
deps: makeStatDepSet(heapStatsDep),
compute: func(in *statAggregate, out *metricValue) {
hist := out.float64HistOrInit(sizeClassBuckets)
// Examples of units might be "seconds", "bytes", "bytes/second", "cpu-seconds",
// "byte*cpu-seconds", and "bytes/second/second".
//
+ // For histograms, multiple units may apply. For instance, the units of the buckets and
+ // the count. By convention, for histograms, the units of the count are always "samples"
+ // with the type of sample evident by the metric's name, while the unit in the name
+ // specifies the buckets' unit.
+ //
// A complete name might look like "/memory/heap/free:bytes".
Name string
Cumulative: true,
},
{
- Name: "/gc/heap/allocs-by-size:objects",
+ Name: "/gc/heap/allocs-by-size:bytes",
Description: "Distribution of all objects allocated by approximate size.",
Kind: KindFloat64Histogram,
},
{
- Name: "/gc/heap/frees-by-size:objects",
+ Name: "/gc/heap/frees-by-size:bytes",
Description: "Distribution of all objects freed by approximate size.",
Kind: KindFloat64Histogram,
},
/gc/cycles/total:gc-cycles
Count of all completed GC cycles.
- /gc/heap/allocs-by-size:objects
+ /gc/heap/allocs-by-size:bytes
Distribution of all objects allocated by approximate size.
- /gc/heap/frees-by-size:objects
+ /gc/heap/frees-by-size:bytes
Distribution of all objects freed by approximate size.
/gc/heap/goal:bytes
checkUint64(t, name, samples[i].Value.Uint64(), mstats.BuckHashSys)
case "/memory/classes/total:bytes":
checkUint64(t, name, samples[i].Value.Uint64(), mstats.Sys)
- case "/gc/heap/allocs-by-size:objects":
+ case "/gc/heap/allocs-by-size:bytes":
hist := samples[i].Value.Float64Histogram()
// Skip size class 0 in BySize, because it's always empty and not represented
// in the histogram.
t.Errorf("histogram counts do not much BySize for class %d: got %d, want %d", i, c, m)
}
}
- case "/gc/heap/frees-by-size:objects":
+ case "/gc/heap/frees-by-size:bytes":
hist := samples[i].Value.Float64Histogram()
// Skip size class 0 in BySize, because it's always empty and not represented
// in the histogram.
totalVirtual.got = samples[i].Value.Uint64()
case "/gc/heap/objects:objects":
objects.total = samples[i].Value.Uint64()
- case "/gc/heap/allocs-by-size:objects":
+ case "/gc/heap/allocs-by-size:bytes":
objects.alloc = samples[i].Value.Float64Histogram()
- case "/gc/heap/frees-by-size:objects":
+ case "/gc/heap/frees-by-size:bytes":
objects.free = samples[i].Value.Float64Histogram()
case "/gc/cycles:gc-cycles":
gc.numGC = samples[i].Value.Uint64()