Documentation ¶
Index ¶
- type PromAPIMock
- func (o *PromAPIMock) AlertManagers(ctx context.Context) (prom_v1.AlertManagersResult, error)
- func (o *PromAPIMock) Alerts(ctx context.Context) (prom_v1.AlertsResult, error)
- func (o *PromAPIMock) AlwaysReturnEmpty()
- func (o *PromAPIMock) Buildinfo(ctx context.Context) (prom_v1.BuildinfoResult, error)
- func (o *PromAPIMock) CleanTombstones(ctx context.Context) error
- func (o *PromAPIMock) Config(ctx context.Context) (prom_v1.ConfigResult, error)
- func (o *PromAPIMock) DeleteSeries(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) error
- func (o *PromAPIMock) Flags(ctx context.Context) (prom_v1.FlagsResult, error)
- func (o *PromAPIMock) LabelNames(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) ([]string, prom_v1.Warnings, error)
- func (o *PromAPIMock) LabelValues(ctx context.Context, label string, matches []string, startTime time.Time, ...) (model.LabelValues, prom_v1.Warnings, error)
- func (o *PromAPIMock) Metadata(ctx context.Context, metric string, limit string) (map[string][]prom_v1.Metadata, error)
- func (o *PromAPIMock) MockEmptyHistoRange(baseName string, suffix string)
- func (o *PromAPIMock) MockEmptyRange(query string)
- func (o *PromAPIMock) MockHistoRange(baseName string, suffix string, retAvg model.SampleValue, ...)
- func (o *PromAPIMock) MockHistoValue(baseName, suffix string, retAvg model.Vector, retMed model.Vector, ...)
- func (o *PromAPIMock) MockHistoValueGroupedBy(baseName, labels, groups string, retAvg model.Vector, retMed model.Vector, ...)
- func (o *PromAPIMock) MockRange(query string, ret model.SampleValue)
- func (o *PromAPIMock) MockRangeErr(query string, ret model.SampleValue)
- func (o *PromAPIMock) MockTime(query string, ret model.Vector)
- func (o *PromAPIMock) OnQueryRange(query string, r *prom_v1.Range, ret model.Matrix)
- func (o *PromAPIMock) OnQueryTime(query string, t *time.Time, ret model.Vector)
- func (o *PromAPIMock) Query(ctx context.Context, query string, ts time.Time, opts ...prom_v1.Option) (model.Value, prom_v1.Warnings, error)
- func (o *PromAPIMock) QueryExemplars(ctx context.Context, query string, startTime time.Time, endTime time.Time) ([]prom_v1.ExemplarQueryResult, error)
- func (o *PromAPIMock) QueryRange(ctx context.Context, query string, r prom_v1.Range, opts ...prom_v1.Option) (model.Value, prom_v1.Warnings, error)
- func (o *PromAPIMock) Rules(ctx context.Context) (prom_v1.RulesResult, error)
- func (o *PromAPIMock) Runtimeinfo(ctx context.Context) (prom_v1.RuntimeinfoResult, error)
- func (o *PromAPIMock) Series(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) ([]model.LabelSet, prom_v1.Warnings, error)
- func (o *PromAPIMock) Snapshot(ctx context.Context, skipHead bool) (prom_v1.SnapshotResult, error)
- func (o *PromAPIMock) SpyArgumentsAndReturnEmpty(fn func(args mock.Arguments))
- func (o *PromAPIMock) TSDB(ctx context.Context) (prom_v1.TSDBResult, error)
- func (o *PromAPIMock) Targets(ctx context.Context) (prom_v1.TargetsResult, error)
- func (o *PromAPIMock) TargetsMetadata(ctx context.Context, matchTarget, metric, limit string) ([]prom_v1.MetricMetadata, error)
- func (o *PromAPIMock) WalReplay(ctx context.Context) (prom_v1.WalReplayStatus, error)
- type PromClientMock
- func (o *PromClientMock) FetchHistogramRange(metricName, labels, grouping string, q *prometheus.RangeQuery) prometheus.Histogram
- func (o *PromClientMock) FetchHistogramValues(metricName, labels, grouping, rateInterval string, avg bool, ...) (map[string]model.Vector, error)
- func (o *PromClientMock) FetchRange(metricName, labels, grouping, aggregator string, q *prometheus.RangeQuery) prometheus.Metric
- func (o *PromClientMock) FetchRateRange(metricName string, labels []string, grouping string, q *prometheus.RangeQuery) prometheus.Metric
- func (o *PromClientMock) GetAllRequestRates(namespace, cluster, ratesInterval string, queryTime time.Time) (model.Vector, error)
- func (o *PromClientMock) GetAppRequestRates(namespace, cluster, app, ratesInterval string, queryTime time.Time) (model.Vector, model.Vector, error)
- func (o *PromClientMock) GetConfiguration() (prom_v1.ConfigResult, error)
- func (o *PromClientMock) GetFlags() (prom_v1.FlagsResult, error)
- func (o *PromClientMock) GetMetricsForLabels(metricNames []string, labels string) ([]string, error)
- func (o *PromClientMock) GetNamespaceServicesRequestRates(namespace, cluster, ratesInterval string, queryTime time.Time) (model.Vector, error)
- func (o *PromClientMock) GetServiceRequestRates(namespace, cluster, service, ratesInterval string, queryTime time.Time) (model.Vector, error)
- func (o *PromClientMock) GetWorkloadRequestRates(namespace, cluster, workload, ratesInterval string, queryTime time.Time) (model.Vector, model.Vector, error)
- func (o *PromClientMock) MockAllRequestRates(namespace, cluster, ratesInterval string, queryTime time.Time, ...)
- func (o *PromClientMock) MockAppRequestRates(namespace, cluster, app string, in, out model.Vector)
- func (o *PromClientMock) MockHistogram(name string, labels string, q *prometheus.RangeQuery, avg, p99 float64)
- func (o *PromClientMock) MockMetric(name string, labels string, q *prometheus.RangeQuery, value float64)
- func (o *PromClientMock) MockMetricsForLabels(metrics []string)
- func (o *PromClientMock) MockNamespaceServicesRequestRates(namespace, ratesInterval string, queryTime time.Time, out model.Vector)
- func (o *PromClientMock) MockServiceRequestRates(namespace, cluster, service string, in model.Vector)
- func (o *PromClientMock) MockWorkloadRequestRates(namespace, cluster, wkld string, in, out model.Vector)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PromAPIMock ¶
PromAPIMock for mocking Prometheus API
func (*PromAPIMock) AlertManagers ¶ added in v0.15.0
func (o *PromAPIMock) AlertManagers(ctx context.Context) (prom_v1.AlertManagersResult, error)
func (*PromAPIMock) Alerts ¶ added in v1.17.0
func (o *PromAPIMock) Alerts(ctx context.Context) (prom_v1.AlertsResult, error)
func (*PromAPIMock) AlwaysReturnEmpty ¶
func (o *PromAPIMock) AlwaysReturnEmpty()
AlwaysReturnEmpty mocks all possible queries to return empty result
func (*PromAPIMock) Buildinfo ¶ added in v1.48.1
func (o *PromAPIMock) Buildinfo(ctx context.Context) (prom_v1.BuildinfoResult, error)
func (*PromAPIMock) CleanTombstones ¶ added in v0.15.0
func (o *PromAPIMock) CleanTombstones(ctx context.Context) error
func (*PromAPIMock) Config ¶ added in v0.15.0
func (o *PromAPIMock) Config(ctx context.Context) (prom_v1.ConfigResult, error)
func (*PromAPIMock) DeleteSeries ¶ added in v0.15.0
func (*PromAPIMock) Flags ¶ added in v0.15.0
func (o *PromAPIMock) Flags(ctx context.Context) (prom_v1.FlagsResult, error)
func (*PromAPIMock) LabelNames ¶ added in v1.29.0
func (*PromAPIMock) LabelValues ¶
func (*PromAPIMock) MockEmptyHistoRange ¶ added in v1.27.0
func (o *PromAPIMock) MockEmptyHistoRange(baseName string, suffix string)
func (*PromAPIMock) MockEmptyRange ¶ added in v1.57.0
func (o *PromAPIMock) MockEmptyRange(query string)
func (*PromAPIMock) MockHistoRange ¶ added in v1.27.0
func (o *PromAPIMock) MockHistoRange(baseName string, suffix string, retAvg model.SampleValue, retMed model.SampleValue, ret95 model.SampleValue, ret99 model.SampleValue)
func (*PromAPIMock) MockHistoValue ¶ added in v1.27.0
func (*PromAPIMock) MockHistoValueGroupedBy ¶ added in v1.27.0
func (*PromAPIMock) MockRange ¶ added in v1.57.0
func (o *PromAPIMock) MockRange(query string, ret model.SampleValue)
func (*PromAPIMock) MockRangeErr ¶ added in v1.57.0
func (o *PromAPIMock) MockRangeErr(query string, ret model.SampleValue)
func (*PromAPIMock) MockTime ¶ added in v1.57.0
func (o *PromAPIMock) MockTime(query string, ret model.Vector)
func (*PromAPIMock) OnQueryRange ¶ added in v1.27.0
func (*PromAPIMock) OnQueryTime ¶ added in v1.27.0
func (*PromAPIMock) QueryExemplars ¶ added in v1.48.1
func (*PromAPIMock) QueryRange ¶
func (*PromAPIMock) Rules ¶ added in v1.17.0
func (o *PromAPIMock) Rules(ctx context.Context) (prom_v1.RulesResult, error)
func (*PromAPIMock) Runtimeinfo ¶ added in v1.29.0
func (o *PromAPIMock) Runtimeinfo(ctx context.Context) (prom_v1.RuntimeinfoResult, error)
func (*PromAPIMock) Snapshot ¶ added in v0.15.0
func (o *PromAPIMock) Snapshot(ctx context.Context, skipHead bool) (prom_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) TSDB ¶ added in v1.29.0
func (o *PromAPIMock) TSDB(ctx context.Context) (prom_v1.TSDBResult, error)
func (*PromAPIMock) Targets ¶ added in v0.15.0
func (o *PromAPIMock) Targets(ctx context.Context) (prom_v1.TargetsResult, error)
func (*PromAPIMock) TargetsMetadata ¶ added in v1.17.0
func (o *PromAPIMock) TargetsMetadata(ctx context.Context, matchTarget, metric, limit string) ([]prom_v1.MetricMetadata, error)
func (*PromAPIMock) WalReplay ¶ added in v1.79.0
func (o *PromAPIMock) WalReplay(ctx context.Context) (prom_v1.WalReplayStatus, error)
type PromClientMock ¶
func (*PromClientMock) FetchHistogramRange ¶ added in v0.12.0
func (o *PromClientMock) FetchHistogramRange(metricName, labels, grouping string, q *prometheus.RangeQuery) prometheus.Histogram
func (*PromClientMock) FetchHistogramValues ¶ added in v1.27.0
func (*PromClientMock) FetchRange ¶ added in v0.14.0
func (o *PromClientMock) FetchRange(metricName, labels, grouping, aggregator string, q *prometheus.RangeQuery) prometheus.Metric
func (*PromClientMock) FetchRateRange ¶ added in v0.12.0
func (o *PromClientMock) FetchRateRange(metricName string, labels []string, grouping string, q *prometheus.RangeQuery) prometheus.Metric
func (*PromClientMock) GetAllRequestRates ¶ added in v0.6.0
func (*PromClientMock) GetAppRequestRates ¶ added in v0.6.0
func (*PromClientMock) GetConfiguration ¶ added in v0.15.0
func (o *PromClientMock) GetConfiguration() (prom_v1.ConfigResult, error)
func (*PromClientMock) GetFlags ¶ added in v0.15.0
func (o *PromClientMock) GetFlags() (prom_v1.FlagsResult, error)
func (*PromClientMock) GetMetricsForLabels ¶ added in v0.17.0
func (o *PromClientMock) GetMetricsForLabels(metricNames []string, labels string) ([]string, error)
func (*PromClientMock) GetNamespaceServicesRequestRates ¶
func (*PromClientMock) GetServiceRequestRates ¶
func (*PromClientMock) GetWorkloadRequestRates ¶ added in v0.6.0
func (*PromClientMock) MockAllRequestRates ¶ added in v1.48.0
func (o *PromClientMock) MockAllRequestRates(namespace, cluster, ratesInterval string, queryTime time.Time, out model.Vector)
MockAllRequestRates mocks GetAllRequestRates for given namespace, rateInverval and queryTime, returning out vector
func (*PromClientMock) MockAppRequestRates ¶ added in v0.13.0
func (o *PromClientMock) MockAppRequestRates(namespace, cluster, app string, in, out model.Vector)
MockAppRequestRates mocks GetAppRequestRates for given namespace and app, returning in & out vectors
func (*PromClientMock) MockHistogram ¶ added in v1.27.0
func (o *PromClientMock) MockHistogram(name string, labels string, q *prometheus.RangeQuery, avg, p99 float64)
func (*PromClientMock) MockMetric ¶ added in v1.27.0
func (o *PromClientMock) MockMetric(name string, labels string, q *prometheus.RangeQuery, value float64)
func (*PromClientMock) MockMetricsForLabels ¶ added in v1.29.1
func (o *PromClientMock) MockMetricsForLabels(metrics []string)
MockMetricsForLabels mocks GetMetricsForLabels
func (*PromClientMock) MockNamespaceServicesRequestRates ¶ added in v1.48.0
func (o *PromClientMock) MockNamespaceServicesRequestRates(namespace, ratesInterval string, queryTime time.Time, out model.Vector)
MockNamespaceServicesRequestRates mocks GetNamespaceServicesRequestRates for given namespace, rateInterval and queryTime, returning out vector
func (*PromClientMock) MockServiceRequestRates ¶ added in v0.13.0
func (o *PromClientMock) MockServiceRequestRates(namespace, cluster, service string, in model.Vector)
MockServiceRequestRates mocks GetServiceRequestRates for given namespace and service, returning in vector
func (*PromClientMock) MockWorkloadRequestRates ¶ added in v0.13.0
func (o *PromClientMock) MockWorkloadRequestRates(namespace, cluster, wkld string, in, out model.Vector)
MockWorkloadRequestRates mocks GetWorkloadRequestRates for given namespace and workload, returning in & out vectors