const timeHistMinBucketBits … const timeHistMaxBucketBits … const timeHistSubBucketBits … const timeHistNumSubBuckets … const timeHistNumBuckets … const timeHistTotalBuckets … type timeHistogram … // record adds the given duration to the distribution. // // Disallow preemptions and stack growths because this function // may run in sensitive locations. // //go:nosplit func (h *timeHistogram) record(duration int64) { … } // write dumps the histogram to the passed metricValue as a float64 histogram. func (h *timeHistogram) write(out *metricValue) { … } const fInf … const fNegInf … func float64Inf() float64 { … } func float64NegInf() float64 { … } // timeHistogramMetricsBuckets generates a slice of boundaries for // the timeHistogram. These boundaries are represented in seconds, // not nanoseconds like the timeHistogram represents durations. func timeHistogramMetricsBuckets() []float64 { … }