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

Function NewSummary

prometheus/summary.go:182–192  ·  view source on GitHub ↗

Problem with the sliding-window decay algorithm... The Merge method of perk/quantile is actually not working as advertised - and it might be unfixable, as the underlying algorithm is apparently not capable of merging summaries in the first place. To avoid using Merge, we are currently adding observa

(opts SummaryOpts)

Source from the content-addressed store, hash-verified

180
181// NewSummary creates a new Summary based on the provided SummaryOpts.
182func NewSummary(opts SummaryOpts) Summary {
183 return newSummary(
184 NewDesc(
185 BuildFQName(opts.Namespace, opts.Subsystem, opts.Name),
186 opts.Help,
187 nil,
188 opts.ConstLabels,
189 ),
190 opts,
191 )
192}
193
194func newSummary(desc *Desc, opts SummaryOpts, labelValues ...string) Summary {
195 if len(desc.variableLabels.names) != len(labelValues) {

Callers 14

ExampleSummaryFunction · 0.92
testHandlerFunction · 0.92
TestToFloat64Function · 0.92
NewSummaryMethod · 0.92
TestTimerObserveFunction · 0.70
benchmarkSummaryObserveFunction · 0.70
benchmarkSummaryWriteFunction · 0.70
TestSummaryConcurrencyFunction · 0.70

Calls 3

newSummaryFunction · 0.85
NewDescFunction · 0.85
BuildFQNameFunction · 0.85

Tested by 13

ExampleSummaryFunction · 0.74
testHandlerFunction · 0.74
TestToFloat64Function · 0.74
TestTimerObserveFunction · 0.56
benchmarkSummaryObserveFunction · 0.56
benchmarkSummaryWriteFunction · 0.56
TestSummaryConcurrencyFunction · 0.56
TestSummaryDecayFunction · 0.56