mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
Merge pull request #115515 from dgrisonnet/scrape-and-compare
Add wrapper around ScrapeAndCompare
This commit is contained in:
commit
0e3818e027
@ -67,6 +67,13 @@ func CustomCollectAndCompare(c metrics.StableCollector, expected io.Reader, metr
|
|||||||
return GatherAndCompare(registry, expected, metricNames...)
|
return GatherAndCompare(registry, expected, metricNames...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ScrapeAndCompare calls a remote exporter's endpoint which is expected to return some metrics in
|
||||||
|
// plain text format. Then it compares it with the results that the `expected` would return.
|
||||||
|
// If the `metricNames` is not empty it would filter the comparison only to the given metric names.
|
||||||
|
func ScrapeAndCompare(url string, expected io.Reader, metricNames ...string) error {
|
||||||
|
return testutil.ScrapeAndCompare(url, expected, metricNames...)
|
||||||
|
}
|
||||||
|
|
||||||
// NewFakeKubeRegistry creates a fake `KubeRegistry` that takes the input version as `build in version`.
|
// NewFakeKubeRegistry creates a fake `KubeRegistry` that takes the input version as `build in version`.
|
||||||
// It should only be used in testing scenario especially for the deprecated metrics.
|
// It should only be used in testing scenario especially for the deprecated metrics.
|
||||||
// The input version format should be `major.minor.patch`, e.g. '1.18.0'.
|
// The input version format should be `major.minor.patch`, e.g. '1.18.0'.
|
||||||
|
Loading…
Reference in New Issue
Block a user