Documentation ¶
Index ¶
- type Client
- func (c *Client) Query(ctx context.Context, query string, ts time.Time, options ...RequestOption) (model.Vector, error)
- func (c *Client) QueryRange(ctx context.Context, query string, start, end time.Time, step time.Duration, ...) (model.Matrix, error)
- func (c *Client) WriteSeries(ctx context.Context, series []prompb.TimeSeries) (int, error)
- type ClientConfig
- type Config
- type Manager
- type ManagerConfig
- type MetricHistory
- type MimirClient
- type RequestOption
- type Test
- type TestMetrics
- type WriteReadSeriesTest
- func (t *WriteReadSeriesTest) Init(ctx context.Context, now time.Time) error
- func (t *WriteReadSeriesTest) Name() string
- func (t *WriteReadSeriesTest) Run(ctx context.Context, now time.Time) error
- func (t *WriteReadSeriesTest) RunInner(ctx context.Context, now time.Time, writeLimiter *rate.Limiter, ...)
- type WriteReadSeriesTestConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Query ¶
func (c *Client) Query(ctx context.Context, query string, ts time.Time, options ...RequestOption) (model.Vector, error)
Query implements MimirClient.
func (*Client) QueryRange ¶
func (c *Client) QueryRange(ctx context.Context, query string, start, end time.Time, step time.Duration, options ...RequestOption) (model.Matrix, error)
QueryRange implements MimirClient.
func (*Client) WriteSeries ¶
WriteSeries implements MimirClient.
type ClientConfig ¶
type ClientConfig struct { TenantID string BasicAuthUser string BasicAuthPassword string BearerToken string WriteBaseEndpoint flagext.URLValue WriteBatchSize int WriteTimeout time.Duration WriteProtocol string ReadBaseEndpoint flagext.URLValue ReadTimeout time.Duration RequestDebug bool UserAgent string }
func (*ClientConfig) RegisterFlags ¶
func (cfg *ClientConfig) RegisterFlags(f *flag.FlagSet)
type Config ¶
type Config struct { Client ClientConfig `yaml:"-"` Manager ManagerConfig `yaml:"-"` WriteReadSeriesTest WriteReadSeriesTestConfig `yaml:"-"` }
func (*Config) RegisterFlags ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(cfg ManagerConfig, logger log.Logger) *Manager
type ManagerConfig ¶
func (*ManagerConfig) RegisterFlags ¶
func (cfg *ManagerConfig) RegisterFlags(f *flag.FlagSet)
type MetricHistory ¶
type MetricHistory struct {
// contains filtered or unexported fields
}
type MimirClient ¶
type MimirClient interface { // WriteSeries writes input series to Mimir. Returns the response status code and optionally // an error. The error is always returned if request was not successful (eg. received a 4xx or 5xx error). WriteSeries(ctx context.Context, series []prompb.TimeSeries) (statusCode int, err error) // QueryRange performs a range query. QueryRange(ctx context.Context, query string, start, end time.Time, step time.Duration, options ...RequestOption) (model.Matrix, error) // Query performs an instant query. Query(ctx context.Context, query string, ts time.Time, options ...RequestOption) (model.Vector, error) }
MimirClient is the interface implemented by a client used to interact with Mimir.
type RequestOption ¶
type RequestOption func(options *requestOptions)
RequestOption defines a functional-style request option.
func WithResultsCacheEnabled ¶
func WithResultsCacheEnabled(enabled bool) RequestOption
WithResultsCacheEnabled controls whether the query-frontend results cache should be enabled or disabled for the request. This function assumes query-frontend results cache is enabled by default.
type Test ¶
type Test interface { // Name returns the test name. The name is used to uniquely identify the test in metrics and logs. Name() string // Init initializes the test. If the initialization fails, the testing tool will terminate. Init(ctx context.Context, now time.Time) error // Run runs a single test cycle. This function is called multiple times, at periodic intervals. // The returned error is ignored unless smoke-test is enabled. In that case, the error is returned to the caller. Run(ctx context.Context, now time.Time) error }
type TestMetrics ¶
type TestMetrics struct {
// contains filtered or unexported fields
}
TestMetrics holds generic metrics tracked by tests. The common metrics are used to enforce the same metric names and labels to track the same information across different tests.
func NewTestMetrics ¶
func NewTestMetrics(testName string, reg prometheus.Registerer) *TestMetrics
func (*TestMetrics) InitializeCountersToZero ¶
func (m *TestMetrics) InitializeCountersToZero(testType string)
type WriteReadSeriesTest ¶
type WriteReadSeriesTest struct {
// contains filtered or unexported fields
}
func NewWriteReadSeriesTest ¶
func NewWriteReadSeriesTest(cfg WriteReadSeriesTestConfig, client MimirClient, logger log.Logger, reg prometheus.Registerer) *WriteReadSeriesTest
func (*WriteReadSeriesTest) Name ¶
func (t *WriteReadSeriesTest) Name() string
Name implements Test.
func (*WriteReadSeriesTest) RunInner ¶
func (t *WriteReadSeriesTest) RunInner(ctx context.Context, now time.Time, writeLimiter *rate.Limiter, errs *multierror.MultiError, metricName, typeLabel string, querySum querySumFunc, generateSeries generateSeriesFunc, generateValue generateValueFunc, generateSampleHistogram generateSampleHistogramFunc, records *MetricHistory)
type WriteReadSeriesTestConfig ¶
type WriteReadSeriesTestConfig struct { NumSeries int MaxQueryAge time.Duration WithFloats bool WithHistograms bool }
func (*WriteReadSeriesTestConfig) RegisterFlags ¶
func (cfg *WriteReadSeriesTestConfig) RegisterFlags(f *flag.FlagSet)