prometheustest

package
v0.13.0-snapshot.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PromAPIMock

type PromAPIMock struct {
	mock.Mock
}

PromAPIMock for mocking Prometheus API

func (*PromAPIMock) AlwaysReturnEmpty

func (o *PromAPIMock) AlwaysReturnEmpty()

AlwaysReturnEmpty mocks all possible queries to return empty result

func (*PromAPIMock) LabelValues

func (o *PromAPIMock) LabelValues(ctx context.Context, label string) (model.LabelValues, error)

func (*PromAPIMock) Query

func (o *PromAPIMock) Query(ctx context.Context, query string, ts time.Time) (model.Value, error)

func (*PromAPIMock) QueryRange

func (o *PromAPIMock) QueryRange(ctx context.Context, query string, r v1.Range) (model.Value, error)

func (*PromAPIMock) Series

func (o *PromAPIMock) Series(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) ([]model.LabelSet, error)

func (*PromAPIMock) SpyArgumentsAndReturnEmpty

func (o *PromAPIMock) SpyArgumentsAndReturnEmpty(fn func(args mock.Arguments))

SpyArgumentsAndReturnEmpty mocks all possible queries to return empty result, allowing to spy arguments through input callback

type PromClientMock

type PromClientMock struct {
	mock.Mock
}

func (*PromClientMock) FetchHistogramRange added in v0.12.0

func (o *PromClientMock) FetchHistogramRange(metricName, labels, grouping string, q *prometheus.BaseMetricsQuery) prometheus.Histogram

func (*PromClientMock) FetchRateRange added in v0.12.0

func (o *PromClientMock) FetchRateRange(metricName, labels, grouping string, q *prometheus.BaseMetricsQuery) *prometheus.Metric

func (*PromClientMock) GetAllRequestRates added in v0.6.0

func (o *PromClientMock) GetAllRequestRates(namespace, ratesInterval string, queryTime time.Time) (model.Vector, error)

func (*PromClientMock) GetAppRequestRates added in v0.6.0

func (o *PromClientMock) GetAppRequestRates(namespace, app, ratesInterval string, queryTime time.Time) (model.Vector, model.Vector, error)

func (*PromClientMock) GetDestinationServices added in v0.11.0

func (o *PromClientMock) GetDestinationServices(namespace string, namespaceCreationTime time.Time, workloadname string) ([]prometheus.Service, error)

func (*PromClientMock) GetMetrics added in v0.12.0

func (*PromClientMock) GetNamespaceServicesRequestRates

func (o *PromClientMock) GetNamespaceServicesRequestRates(namespace, ratesInterval string, queryTime time.Time) (model.Vector, error)

func (*PromClientMock) GetServiceHealth

func (o *PromClientMock) GetServiceHealth(namespace, servicename string, ports []int32) (prometheus.EnvoyServiceHealth, error)

func (*PromClientMock) GetServiceRequestRates

func (o *PromClientMock) GetServiceRequestRates(namespace, service, ratesInterval string, queryTime time.Time) (model.Vector, error)

func (*PromClientMock) GetSourceWorkloads added in v0.6.0

func (o *PromClientMock) GetSourceWorkloads(namespace string, namespaceCreationTime time.Time, servicename string) (map[string][]prometheus.Workload, error)

func (*PromClientMock) GetWorkloadRequestRates added in v0.6.0

func (o *PromClientMock) GetWorkloadRequestRates(namespace, workload, ratesInterval string, queryTime time.Time) (model.Vector, model.Vector, error)

Jump to

Keyboard shortcuts

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