Documentation ¶
Overview ¶
Package testmetrics is for testing provider metrics with a test Provider that adheres to the Provider interface
Index ¶
- type Counter
- type Gauge
- type Histogram
- type Provider
- func (p *Provider) CheckCardinalityCounter(name string, estimate uint64)
- func (p *Provider) CheckCounter(name string, v float64, labelValues ...string)
- func (p *Provider) CheckGauge(name string, v float64, labelValues ...string)
- func (p *Provider) CheckGaugeNonZero(name string, labelValues ...string)
- func (p *Provider) CheckNoCounter(name string, labelValues ...string)
- func (p *Provider) CheckNoGauge(name string, labelValues ...string)
- func (p *Provider) CheckObservationCount(name string, n int, labelValues ...string)
- func (p *Provider) CheckObservations(name string, obs []float64, labelValues ...string)
- func (p *Provider) CheckObservationsMatch(name string, obs []float64, labelValues ...string)
- func (p *Provider) CheckObservationsMinMax(name string, min, max float64, labelValues ...string)
- func (p *Provider) CheckStopped()
- func (p *Provider) NewCardinalityCounter(name string) xmetrics.CardinalityCounter
- func (p *Provider) NewCounter(name string) metrics.Counter
- func (p *Provider) NewGauge(name string) metrics.Gauge
- func (p *Provider) NewHistogram(name string, _ int) metrics.Histogram
- func (p *Provider) PrintCounterValue(name string)
- func (p *Provider) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
Counter accumulates a value based on Add calls.
type Histogram ¶
Histogram collects observations without computing quantiles so the observations can be checked by tests.
type Provider ¶
Provider collects registered metrics for testing.
func NewProvider ¶
NewProvider constructs a test provider which can later be checked.
func (*Provider) CheckCardinalityCounter ¶
CheckCardinalityCounter checks that there is a registered cardinality counter with the name and estimate provided.
func (*Provider) CheckCounter ¶
CheckCounter checks that there is a registered counter with the name and value provided.
func (*Provider) CheckGauge ¶
CheckGauge checks that there is a registered gauge with the name and value provided.
func (*Provider) CheckGaugeNonZero ¶
CheckGaugeNonZero checks that there is a registered gauge with the name provided whose value is != 0.
func (*Provider) CheckNoCounter ¶
CheckNoCounter checks that there is no registered counter with the name provided.
func (*Provider) CheckNoGauge ¶
CheckNoGauge checks that there is no registered gauge with the name provided.
func (*Provider) CheckObservationCount ¶
CheckObservationCount checks that there is a histogram with the name and number of observations provided.
func (*Provider) CheckObservations ¶
CheckObservations checks that there is a histogram with the name and observations provided.
func (*Provider) CheckObservationsMatch ¶
CheckObservationsMatch checks that there is a histogram with the name and observations provided, ignoring order.
func (*Provider) CheckObservationsMinMax ¶
CheckObservationsMinMax checks that there is a histogram with the name and that the values all fall within the min/max range.
func (*Provider) CheckStopped ¶
func (p *Provider) CheckStopped()
CheckStopped verifies that a provider has been Stop'd.
func (*Provider) NewCardinalityCounter ¶
func (p *Provider) NewCardinalityCounter(name string) xmetrics.CardinalityCounter
NewCardinalityCounter implements metrics.Provider.
func (*Provider) NewCounter ¶
NewCounter implements go-kit's Provider interface.
func (*Provider) NewHistogram ¶
NewHistogram implements go-kit's Provider interface.
func (*Provider) PrintCounterValue ¶ added in v0.0.10
PrintCounterValue prints the value of the specified counter and their current counts