MCPcopy
hub / github.com/prometheus/client_golang / batchHistogram

Struct batchHistogram

prometheus/go_collector_latest.go:463–478  ·  view source on GitHub ↗

batchHistogram is a mutable histogram that is updated in batches.

Source from the content-addressed store, hash-verified

461// batchHistogram is a mutable histogram that is updated
462// in batches.
463type batchHistogram struct {
464 selfCollector
465
466 // Static fields updated only once.
467 desc *Desc
468 hasSum bool
469
470 // Because this histogram operates in batches, it just uses a
471 // single mutex for everything. updates are always serialized
472 // but Write calls may operate concurrently with updates.
473 // Contention between these two sources should be rare.
474 mu sync.Mutex
475 buckets []float64 // Inclusive lower bounds, like runtime/metrics.
476 counts []uint64
477 sum float64 // Used if hasSum is true.
478}
479
480// newBatchHistogram creates a new batch histogram value with the given
481// Desc, buckets, and whether or not it has an exact sum available.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected