prometheustest

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 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) AlertManagers

func (o *PromAPIMock) AlertManagers(ctx context.Context) (v1.AlertManagersResult, error)

func (*PromAPIMock) AlwaysReturnEmpty

func (o *PromAPIMock) AlwaysReturnEmpty()

AlwaysReturnEmpty mocks all possible queries to return empty result

func (*PromAPIMock) CleanTombstones

func (o *PromAPIMock) CleanTombstones(ctx context.Context) error

func (*PromAPIMock) Config

func (o *PromAPIMock) Config(ctx context.Context) (v1.ConfigResult, error)

func (*PromAPIMock) DeleteSeries

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

func (*PromAPIMock) Flags

func (o *PromAPIMock) Flags(ctx context.Context) (v1.FlagsResult, error)

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) Snapshot

func (o *PromAPIMock) Snapshot(ctx context.Context, skipHead bool) (v1.SnapshotResult, 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

func (*PromAPIMock) Targets

func (o *PromAPIMock) Targets(ctx context.Context) (v1.TargetsResult, error)

type PromClientMock

type PromClientMock struct {
	mock.Mock
}

func (*PromClientMock) FetchHistogramRange

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

func (*PromClientMock) FetchRange

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

func (*PromClientMock) FetchRateRange

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

func (*PromClientMock) GetAllRequestRates

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

func (*PromClientMock) GetAppRequestRates

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

func (*PromClientMock) GetConfiguration

func (o *PromClientMock) GetConfiguration() (v1.ConfigResult, error)

func (*PromClientMock) GetDestinationServices

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

func (*PromClientMock) GetFlags

func (o *PromClientMock) GetFlags() (v1.FlagsResult, error)

func (*PromClientMock) GetMetrics

func (*PromClientMock) GetNamespaceServicesRequestRates

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

func (*PromClientMock) GetServiceRequestRates

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

func (*PromClientMock) GetSourceWorkloads

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

func (*PromClientMock) GetWorkloadRequestRates

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

func (*PromClientMock) MockAppRequestRates

func (o *PromClientMock) MockAppRequestRates(namespace, app string, in, out model.Vector)

MockAppRequestRates mocks GetAppRequestRates for given namespace and app, returning in & out vectors

func (*PromClientMock) MockServiceRequestRates

func (o *PromClientMock) MockServiceRequestRates(namespace, service string, in model.Vector)

MockServiceRequestRates mocks GetServiceRequestRates for given namespace and service, returning in vector

func (*PromClientMock) MockWorkloadRequestRates

func (o *PromClientMock) MockWorkloadRequestRates(namespace, wkld string, in, out model.Vector)

MockWorkloadRequestRates mocks GetWorkloadRequestRates for given namespace and workload, returning in & out vectors

Jump to

Keyboard shortcuts

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