Standard library / runtime/metrics
metrics.Float64Histogram
Distribution with one count per adjacent pair of bucket boundaries. The lower bound is inclusive and the upper bound exclusive. Copy before modifying or retaining mutable storage. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
type Float64Histogram struct { Counts []uint64
Buckets []float64}Working Example
Example Snippetgo
package main
import ( "fmt" "runtime/metrics")
func main() { s := []metrics.Sample{{Name: "/gc/pauses:seconds"}} metrics.Read(s) h := s[0].Value.Float64Histogram() fmt.Println(len(h.Buckets) == len(h.Counts)+1)}