compareMetricFamilies would compare 2 slices of metric families, and optionally filters both of them to the `metricNames` provided.
(got, expected []*dto.MetricFamily, metricNames ...string)
| 288 | // compareMetricFamilies would compare 2 slices of metric families, and optionally filters both of |
| 289 | // them to the `metricNames` provided. |
| 290 | func compareMetricFamilies(got, expected []*dto.MetricFamily, metricNames ...string) error { |
| 291 | if metricNames != nil { |
| 292 | got = filterMetrics(got, metricNames) |
| 293 | expected = filterMetrics(expected, metricNames) |
| 294 | } |
| 295 | |
| 296 | return compare(got, expected) |
| 297 | } |
| 298 | |
| 299 | // compare encodes both provided slices of metric families into the text format, |
| 300 | // compares their string message, and returns an error if they do not match. |
no test coverage detected