NewSummaryVec creates a new SummaryVec based on the provided SummaryVecOpts.
(opts SummaryVecOpts)
| 568 | |
| 569 | // NewSummaryVec creates a new SummaryVec based on the provided SummaryVecOpts. |
| 570 | func (v2) NewSummaryVec(opts SummaryVecOpts) *SummaryVec { |
| 571 | for _, ln := range opts.VariableLabels.labelNames() { |
| 572 | if ln == quantileLabel { |
| 573 | panic(errQuantileLabelNotAllowed) |
| 574 | } |
| 575 | } |
| 576 | desc := V2.NewDesc( |
| 577 | BuildFQName(opts.Namespace, opts.Subsystem, opts.Name), |
| 578 | opts.Help, |
| 579 | opts.VariableLabels, |
| 580 | opts.ConstLabels, |
| 581 | ) |
| 582 | return &SummaryVec{ |
| 583 | MetricVec: NewMetricVec(desc, func(lvs ...string) Metric { |
| 584 | return newSummary(desc, opts.SummaryOpts, lvs...) |
| 585 | }), |
| 586 | } |
| 587 | } |
| 588 | |
| 589 | // GetMetricWithLabelValues returns the Summary for the given slice of label |
| 590 | // values (same order as the variable labels in Desc). If that combination of |
no test coverage detected