FromLabelPairsToLabels converts dto.LabelPair into labels.Labels.
(pairs []*dto.LabelPair)
| 733 | |
| 734 | // FromLabelPairsToLabels converts dto.LabelPair into labels.Labels. |
| 735 | func FromLabelPairsToLabels(pairs []*dto.LabelPair) labels.Labels { |
| 736 | builder := labels.NewBuilder(labels.EmptyLabels()) |
| 737 | for _, pair := range pairs { |
| 738 | builder.Set(pair.GetName(), pair.GetValue()) |
| 739 | } |
| 740 | return builder.Labels() |
| 741 | } |
| 742 | |
| 743 | // GetSumOfHistogramSampleCount returns the sum of samples count of histograms matching the provided metric name |
| 744 | // and optional label matchers. Returns 0 if no metric matches. |
no test coverage detected