Documentation ¶
Index ¶
- func AssertMetricsUnique(ch chan *prometheus.Desc, t *testing.T)
- func CompareMetrics(got map[string]float64, expected map[string]float64, t *testing.T)
- func PrepareErrorForTesting(err error) connector.SSHCommandContext
- func PrepareMetricsForTesting(ch chan prometheus.Metric, t *testing.T) map[string]float64
- func PrepareOutputForTesting(input string) connector.SSHCommandContext
- func Str2float64(str string) float64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertMetricsUnique ¶ added in v1.0.3
func AssertMetricsUnique(ch chan *prometheus.Desc, t *testing.T)
AssertMetricsUnique takes metric descriptions from a channel and asserts they are unique
func CompareMetrics ¶
CompareMetrics asserts all metrics that are expected are present and checks their value It does not complain about additional metrics being present
func PrepareErrorForTesting ¶ added in v1.0.3
func PrepareErrorForTesting(err error) connector.SSHCommandContext
PrepareErrorForTesting takes an error and returns a ssh command context that raises the error
func PrepareMetricsForTesting ¶
PrepareMetricsForTesting takes metrics from a channel and converts them to a map, mapping the metric (format `metric_example{label1=foo,bar=asdf}`) to it's value.
func PrepareOutputForTesting ¶
func PrepareOutputForTesting(input string) connector.SSHCommandContext
PrepareOutputForTesting takes a string and returns a ssh command context that reads the input linewise
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.