Documentation
¶
Overview ¶
Package metrics provides Ginkgo/Gomega assertions over the metrics scraped from instance pods: presence/absence checks and contents of custom metric ConfigMaps/Secrets.
Index ¶
- func AssertCustomMetricsResourcesExist(env *environment.TestingEnvironment, namespace, sampleFile string, ...)
- func AssertExcludesMetrics(g Gomega, rawMetricsOutput string, nonCollected []string)
- func AssertIncludesMetrics(g Gomega, rawMetricsOutput string, expectedMetrics map[string]*regexp.Regexp)
- func AssertMetricsData(env *environment.TestingEnvironment, testTimeouts map[timeouts.Timeout]int, ...)
- func CollectAndAssertCollectorMetricsPresentOnEachPod(env *environment.TestingEnvironment, testTimeouts map[timeouts.Timeout]int, ...)
- func CollectAndAssertDefaultMetricsPresentOnEachPod(env *environment.TestingEnvironment, testTimeouts map[timeouts.Timeout]int, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertCustomMetricsResourcesExist ¶
func AssertCustomMetricsResourcesExist( env *environment.TestingEnvironment, namespace, sampleFile string, configMapsCount, secretsCount int, )
AssertCustomMetricsResourcesExist creates the resources defined in the given sample file and verifies they produce the expected number of ConfigMaps and Secrets tagged with e2e=metrics.
func AssertExcludesMetrics ¶
AssertExcludesMetrics asserts that every entry in nonCollected is absent from rawMetricsOutput.
func AssertIncludesMetrics ¶
func AssertIncludesMetrics(g Gomega, rawMetricsOutput string, expectedMetrics map[string]*regexp.Regexp)
AssertIncludesMetrics asserts that every expected metric name appears in rawMetricsOutput and that its value matches the supplied regexp.
func AssertMetricsData ¶
func AssertMetricsData( env *environment.TestingEnvironment, testTimeouts map[timeouts.Timeout]int, namespace, targetOne, targetTwo, targetSecret string, cluster *apiv1.Cluster, )
AssertMetricsData scrapes each pod and verifies the target-database custom metrics are present. On the primary pod, it also expects the backup timestamp metrics to be exposed.
func CollectAndAssertCollectorMetricsPresentOnEachPod ¶
func CollectAndAssertCollectorMetricsPresentOnEachPod( env *environment.TestingEnvironment, testTimeouts map[timeouts.Timeout]int, cluster *apiv1.Cluster, )
CollectAndAssertCollectorMetricsPresentOnEachPod verifies the cnpg collector metrics (collection_duration, fencing, wal stats, …) are exposed on every pod of the cluster.
func CollectAndAssertDefaultMetricsPresentOnEachPod ¶
func CollectAndAssertDefaultMetricsPresentOnEachPod( env *environment.TestingEnvironment, testTimeouts map[timeouts.Timeout]int, namespace, clusterName string, tlsEnabled bool, expectPresent bool, )
CollectAndAssertDefaultMetricsPresentOnEachPod verifies the default set of cnpg_* metrics is present (or absent) on every pod of the cluster.
Types ¶
This section is empty.