util

package
v0.0.0-...-8c24509 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2019 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FoundMetric

func FoundMetric(metrics []byte, mtrName string) (bool, error)

FoundMetric return true if found a metric with mtrName inside a metrics endpoint response as plain text.

func GetCounterValue

func GetCounterValue(metrics []byte, mtrName string) (float64, error)

GetCounterValue return a number(the counter value) if found a metric with mtrName and if a Counter kind metric from a metrics endpoint response as plain text.

func GetGaugeValue

func GetGaugeValue(metrics []byte, mtrName string) (float64, error)

GetGaugeValue return a number(the gauge value) if found a metric with mtrName and if a Gauge kind metric from a metrics endpoint response as plain text.

Types

type HistogramValue

type HistogramValue struct {
	SampleCount uint64
	SampleSum   float64
	Buckets     map[float64]uint64
}

HistogramValue have some field to fill a histograms instance an compare against some receive value in an integration test

func GetHistogramValue

func GetHistogramValue(metrics []byte, mtrName string) (HistogramValue, error)

GetHistogramValue return a HistogramValue instance looking into the metrics body for a metric with the name mtrName

type LabelValue

type LabelValue struct {
	Name  string
	Value string
}

LabelValue have some field to fill a label instance an compare against some received value in an integration test

type MetricVal

type MetricVal struct {
	Labels []LabelValue
	Number float64
}

MetricVal have some field to fill a labeled metric instance an compare against some received value in an integration test

type NumericVec

type NumericVec struct {
	Values []MetricVal
}

NumericVec have some field to fill a metric vec(with labels) instance an compare against some received value in an integration test

func GetNumericVecValues

func GetNumericVecValues(metrics []byte, mtrName string) (NumericVec, error)

GetNumericVecValues return a NumericVec instance looking into the metrics body for a metric with the name mtrName

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL