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

Function GatherAndCompare

prometheus/testutil/testutil.go:211–213  ·  view source on GitHub ↗

GatherAndCompare gathers all metrics from the provided Gatherer and compares it to an expected output read from the provided Reader in the Prometheus text exposition format. If any metricNames are provided, only metrics with those names are compared. NOTE: Be mindful of accidental discrepancies bet

(g prometheus.Gatherer, expected io.Reader, metricNames ...string)

Source from the content-addressed store, hash-verified

209// NOTE: Be mindful of accidental discrepancies between expected and metricNames; metricNames filter
210// both expected and gathered metrics. See https://github.com/prometheus/client_golang/issues/1351.
211func GatherAndCompare(g prometheus.Gatherer, expected io.Reader, metricNames ...string) error {
212 return TransactionalGatherAndCompare(prometheus.ToTransactionalGatherer(g), expected, metricNames...)
213}
214
215// TransactionalGatherAndCompare gathers all metrics from the provided Gatherer and compares
216// it to an expected output read from the provided Reader in the Prometheus text

Callers 2

CollectAndCompareFunction · 0.85

Calls 2

ToTransactionalGathererFunction · 0.92