exactSumFor takes a runtime/metrics metric name (that is assumed to be of kind KindFloat64Histogram) and returns its exact sum and whether its exact sum exists. The runtime/metrics API for histograms doesn't currently expose exact sums, but some of the other metrics are in fact exact sums of histog
(rmName string)
| 400 | // The runtime/metrics API for histograms doesn't currently expose exact |
| 401 | // sums, but some of the other metrics are in fact exact sums of histograms. |
| 402 | func (c *goCollector) exactSumFor(rmName string) float64 { |
| 403 | sumName, ok := c.rmExactSumMapForHist[rmName] |
| 404 | if !ok { |
| 405 | return 0 |
| 406 | } |
| 407 | s, ok := c.sampleMap[sumName] |
| 408 | if !ok { |
| 409 | return 0 |
| 410 | } |
| 411 | return unwrapScalarRMValue(s.Value) |
| 412 | } |
| 413 | |
| 414 | func memStatsFromRM(ms *runtime.MemStats, rm map[string]*metrics.Sample) { |
| 415 | lookupOrZero := func(name string) uint64 { |
no test coverage detected