m3

package
Version: v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 43 Imported by: 11

Documentation

Overview

Package m3 is a generated GoMock package.

Index

Constants

View Source
const (
	// ClusterConfigTypeStatic is for static configuration.
	ClusterConfigTypeStatic = iota
	// ClusterConfigTypeDynamic is for dynamic configuration.
	ClusterConfigTypeDynamic
)

Variables

View Source
var (

	// DefaultClusterNamespaceDownsampleOptions is a default options.
	// NB(antanas): this was made public to access it in promremote storage.
	// Ideally downsampling could be decoupled from m3 storage.
	DefaultClusterNamespaceDownsampleOptions = ClusterNamespaceDownsampleOptions{
		All: true,
	}
)

Functions

func ConvertM3DBSeriesIterators added in v1.2.0

func ConvertM3DBSeriesIterators(
	result consolidators.SeriesFetchResult,
	bounds models.Bounds,
	opts Options,
) ([]block.Block, error)

ConvertM3DBSeriesIterators converts series iterators to iterator blocks. If lookback is greater than 0, converts the entire series into a single block, otherwise, splits the series into blocks.

func FetchResultToBlockResult added in v0.15.0

func FetchResultToBlockResult(
	result consolidators.SeriesFetchResult,
	query *storage.FetchQuery,
	options *storage.FetchOptions,
	opts Options,
) (block.Result, error)

FetchResultToBlockResult converts an encoded SeriesIterator fetch result into blocks.

func NewEncodedBlock added in v1.2.0

func NewEncodedBlock(
	result consolidators.SeriesFetchResult,
	bounds models.Bounds,
	lastBlock bool,
	opts Options,
) (block.Block, error)

NewEncodedBlock builds an encoded block.

func NewEncodedSeriesIter added in v1.2.0

func NewEncodedSeriesIter(
	meta block.Metadata,
	seriesMetas []block.SeriesMeta,
	seriesIters []encoding.SeriesIterator,
	instrumented bool,
) block.SeriesIter

NewEncodedSeriesIter creates a new encoded series iterator.

Types

type AggregatedClusterNamespaceDefinition

type AggregatedClusterNamespaceDefinition struct {
	NamespaceID ident.ID
	Session     client.Session
	Retention   time.Duration
	Resolution  time.Duration
	Downsample  *ClusterNamespaceDownsampleOptions
	DataLatency time.Duration
	ReadOnly    bool
}

AggregatedClusterNamespaceDefinition is a definition for a cluster namespace that holds aggregated metrics data at a specific retention and resolution.

func (AggregatedClusterNamespaceDefinition) Validate

Validate validates the cluster namespace definition.

type BlockSeriesProcessor added in v1.2.0

type BlockSeriesProcessor interface {
	Process(bl block.Block, opts Options, fn BlockSeriesProcessorFn) error
}

BlockSeriesProcessor processes blocks.

func NewBlockSeriesProcessor added in v1.2.0

func NewBlockSeriesProcessor() BlockSeriesProcessor

NewBlockSeriesProcessor creates a standard block processor.

type BlockSeriesProcessorFn added in v1.2.0

type BlockSeriesProcessorFn func(
	iter block.SeriesIter,
) error

BlockSeriesProcessorFn processes an individual series iterator.

type Cleanup

type Cleanup func() error

Cleanup is a cleanup function to be called after resources are freed.

type ClusterConfigType added in v1.2.0

type ClusterConfigType int

ClusterConfigType is an enum representing the configuration used to create a Clusters interface

type ClusterNamespace

type ClusterNamespace interface {
	NamespaceID() ident.ID
	Options() ClusterNamespaceOptions
	Session() client.Session
}

ClusterNamespace is a local storage cluster namespace.

type ClusterNamespaceDownsampleOptions

type ClusterNamespaceDownsampleOptions struct {
	All bool
}

ClusterNamespaceDownsampleOptions is the downsample options for a cluster namespace.

type ClusterNamespaceOptions

type ClusterNamespaceOptions struct {
	// contains filtered or unexported fields
}

ClusterNamespaceOptions is a set of options

func NewClusterNamespaceOptions added in v1.2.0

func NewClusterNamespaceOptions(
	attributes storagemetadata.Attributes,
	downsample *ClusterNamespaceDownsampleOptions,
) ClusterNamespaceOptions

NewClusterNamespaceOptions creates new cluster namespace options.

func (ClusterNamespaceOptions) Attributes

Attributes returns the storage attributes of the cluster namespace.

func (ClusterNamespaceOptions) DataLatency added in v1.4.2

func (o ClusterNamespaceOptions) DataLatency() time.Duration

DataLatency returns the duration after which the data is available in this cluster namespace.

func (ClusterNamespaceOptions) DownsampleOptions

DownsampleOptions returns the downsample options for a cluster namespace, which is only valid if the namespace is an aggregated cluster namespace.

func (ClusterNamespaceOptions) ReadOnly added in v1.4.2

func (o ClusterNamespaceOptions) ReadOnly() bool

ReadOnly returns the value of ReadOnly option for a cluster namespace.

type ClusterNamespaces

type ClusterNamespaces []ClusterNamespace

ClusterNamespaces is a slice of ClusterNamespace instances.

func (ClusterNamespaces) NumAggregatedClusterNamespaces

func (n ClusterNamespaces) NumAggregatedClusterNamespaces() int

NumAggregatedClusterNamespaces returns the number of aggregated cluster namespaces.

type ClusterNamespacesListener added in v1.0.0

type ClusterNamespacesListener interface {
	// OnUpdate is called when updates have occurred passing in the new namespaces.
	OnUpdate(namespaces ClusterNamespaces)
}

ClusterNamespacesListener is a listener for receiving updates from a ClusterNamespacesWatcher.

type ClusterNamespacesWatcher added in v1.0.0

type ClusterNamespacesWatcher interface {
	// Update updates the current namespaces.
	Update(namespaces ClusterNamespaces) error

	// Get returns the current namespaces.
	Get() ClusterNamespaces

	// RegisterListener registers a listener for updates to cluster namespaces.
	// If a value is currently present, it will synchronously call back the listener.
	RegisterListener(listener ClusterNamespacesListener) xresource.SimpleCloser

	// Close closes the watcher and all descendent watches.
	Close()
}

ClusterNamespacesWatcher allows interested parties to watch for changes to the cluster namespaces and register callbacks to be invoked when changes are detected.

func NewClusterNamespacesWatcher added in v1.0.0

func NewClusterNamespacesWatcher() ClusterNamespacesWatcher

NewClusterNamespacesWatcher creates a new ClusterNamespacesWatcher.

type ClusterStaticConfiguration

type ClusterStaticConfiguration struct {
	NewClientFromConfig NewClientFromConfig                   `yaml:"-"`
	Namespaces          []ClusterStaticNamespaceConfiguration `yaml:"namespaces"`
	Client              client.Configuration                  `yaml:"client"`
}

ClusterStaticConfiguration is a static cluster configuration.

type ClusterStaticNamespaceConfiguration

type ClusterStaticNamespaceConfiguration struct {
	// Namespace is namespace in the cluster that is specified.
	Namespace string `yaml:"namespace"`

	// Type is the type of values stored by the namespace, current
	// supported values are "unaggregated" or "aggregated".
	Type storagemetadata.MetricsType `yaml:"type"`

	// Retention is the length of which values are stored by the namespace.
	Retention time.Duration `yaml:"retention" validate:"nonzero"`

	// Resolution is the frequency of which values are stored by the namespace.
	Resolution time.Duration `yaml:"resolution" validate:"min=0"`

	// Downsample is the configuration for downsampling options to use with
	// the namespace.
	Downsample *DownsampleClusterStaticNamespaceConfiguration `yaml:"downsample"`

	// ReadOnly prevents any writes to this namespace.
	ReadOnly bool `yaml:"readOnly"`

	// DataLatency is the duration after which the data is available in this namespace.
	DataLatency time.Duration `yaml:"dataLatency"`
}

ClusterStaticNamespaceConfiguration describes the namespaces in a static cluster.

type Clusters

type Clusters interface {
	io.Closer

	// ClusterNamespaces returns all known and ready cluster namespaces.
	ClusterNamespaces() ClusterNamespaces

	// NonReadyClusterNamespaces returns all cluster namespaces not in the ready state.
	NonReadyClusterNamespaces() ClusterNamespaces

	// UnaggregatedClusterNamespace returns the valid unaggregated
	// cluster namespace. If the namespace is not yet initialized, returns false.
	UnaggregatedClusterNamespace() (ClusterNamespace, bool)

	// AggregatedClusterNamespace returns an aggregated cluster namespace
	// at a specific retention and resolution.
	AggregatedClusterNamespace(attrs RetentionResolution) (ClusterNamespace, bool)

	// ConfigType returns the type of configuration used to create this Clusters
	// object.
	ConfigType() ClusterConfigType
}

Clusters is a flattened collection of local storage clusters and namespaces.

func NewClusters

func NewClusters(
	unaggregatedClusterNamespace UnaggregatedClusterNamespaceDefinition,
	aggregatedClusterNamespaces ...AggregatedClusterNamespaceDefinition,
) (Clusters, error)

NewClusters instantiates a new Clusters instance.

func NewDynamicClusters added in v1.0.0

func NewDynamicClusters(opts DynamicClusterOptions) (Clusters, error)

NewDynamicClusters creates an implementation of the Clusters interface supports dynamic updating of cluster namespaces.

type ClustersStaticConfiguration

type ClustersStaticConfiguration []ClusterStaticConfiguration

ClustersStaticConfiguration is a set of static cluster configurations.

func (ClustersStaticConfiguration) NewDynamicClusters added in v1.0.0

func (c ClustersStaticConfiguration) NewDynamicClusters(
	instrumentOpts instrument.Options,
	opts ClustersStaticConfigurationOptions,
	clusterNamespacesWatcher ClusterNamespacesWatcher,
) (Clusters, error)

NewDynamicClusters instantiates a new Clusters instance that pulls cluster information from etcd.

func (ClustersStaticConfiguration) NewStaticClusters added in v1.0.0

func (c ClustersStaticConfiguration) NewStaticClusters(
	instrumentOpts instrument.Options,
	opts ClustersStaticConfigurationOptions,
	clusterNamespacesWatcher ClusterNamespacesWatcher,
) (Clusters, error)

NewStaticClusters instantiates a new Clusters instance based on static configuration.

type ClustersStaticConfigurationOptions

type ClustersStaticConfigurationOptions struct {
	AsyncSessions      bool
	ProvidedSession    client.Session
	CustomAdminOptions []client.CustomAdminOption
	EncodingOptions    encoding.Options
}

ClustersStaticConfigurationOptions are options to use when constructing clusters from config.

type DownsampleClusterStaticNamespaceConfiguration

type DownsampleClusterStaticNamespaceConfiguration struct {
	All bool `yaml:"all"`
}

DownsampleClusterStaticNamespaceConfiguration is configuration specified for downsampling options on an aggregated cluster namespace.

type DynamicClusterNamespaceConfiguration added in v1.0.0

type DynamicClusterNamespaceConfiguration struct {
	// contains filtered or unexported fields
}

DynamicClusterNamespaceConfiguration is the configuration for dynamically fetching namespace configuration.

type DynamicClusterOptions added in v1.0.0

type DynamicClusterOptions interface {
	// Validate validates the DynamicClusterOptions.
	Validate() error

	// SetDynamicClusterNamespaceConfiguration sets the configuration for the dynamically fetching cluster namespaces.
	SetDynamicClusterNamespaceConfiguration(value []DynamicClusterNamespaceConfiguration) DynamicClusterOptions

	// DynamicClusterNamespaceConfiguration returns the configuration for the dynamically fetching cluster namespaces.
	DynamicClusterNamespaceConfiguration() []DynamicClusterNamespaceConfiguration

	// SetInstrumentOptions sets the instrument options.
	SetInstrumentOptions(value instrument.Options) DynamicClusterOptions

	// InstrumentOptions returns the instrument options.
	InstrumentOptions() instrument.Options

	// SetClusterNamespacesWatcher sets the namespaces watcher which alerts components that
	// need to regenerate configuration when the ClusterNamespaces change.
	SetClusterNamespacesWatcher(value ClusterNamespacesWatcher) DynamicClusterOptions

	// ClusterNamespacesWatcher returns the namespaces watcher which alerts components that
	// need to regenerate configuration when the ClusterNamespaces change.
	ClusterNamespacesWatcher() ClusterNamespacesWatcher
}

DynamicClusterOptions is the options for a new dynamic Cluster.

func NewDynamicClusterOptions added in v1.0.0

func NewDynamicClusterOptions() DynamicClusterOptions

NewDynamicClusterOptions returns new DynamicClusterOptions.

type GraphiteBlockIteratorsFn added in v1.2.0

type GraphiteBlockIteratorsFn func(
	block.Block,
) ([]block.SeriesIterBatch, error)

GraphiteBlockIteratorsFn returns block iterators for graphite decoding.

type IteratorBatchingFn added in v1.2.0

type IteratorBatchingFn func(
	concurrency int,
	seriesBlockIterators []encoding.SeriesIterator,
	seriesMetas []block.SeriesMeta,
	meta block.Metadata,
	opts Options,
) ([]block.SeriesIterBatch, error)

IteratorBatchingFn determines how the iterator is split into batches.

type MockClusterNamespace added in v1.2.0

type MockClusterNamespace struct {
	// contains filtered or unexported fields
}

MockClusterNamespace is a mock of ClusterNamespace interface.

func NewMockClusterNamespace added in v1.2.0

func NewMockClusterNamespace(ctrl *gomock.Controller) *MockClusterNamespace

NewMockClusterNamespace creates a new mock instance.

func (*MockClusterNamespace) EXPECT added in v1.2.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClusterNamespace) NamespaceID added in v1.2.0

func (m *MockClusterNamespace) NamespaceID() ident.ID

NamespaceID mocks base method.

func (*MockClusterNamespace) Options added in v1.2.0

Options mocks base method.

func (*MockClusterNamespace) Session added in v1.2.0

func (m *MockClusterNamespace) Session() client.Session

Session mocks base method.

type MockClusterNamespaceMockRecorder added in v1.2.0

type MockClusterNamespaceMockRecorder struct {
	// contains filtered or unexported fields
}

MockClusterNamespaceMockRecorder is the mock recorder for MockClusterNamespace.

func (*MockClusterNamespaceMockRecorder) NamespaceID added in v1.2.0

func (mr *MockClusterNamespaceMockRecorder) NamespaceID() *gomock.Call

NamespaceID indicates an expected call of NamespaceID.

func (*MockClusterNamespaceMockRecorder) Options added in v1.2.0

Options indicates an expected call of Options.

func (*MockClusterNamespaceMockRecorder) Session added in v1.2.0

Session indicates an expected call of Session.

type MockClusters added in v1.4.2

type MockClusters struct {
	// contains filtered or unexported fields
}

MockClusters is a mock of Clusters interface.

func NewMockClusters added in v1.4.2

func NewMockClusters(ctrl *gomock.Controller) *MockClusters

NewMockClusters creates a new mock instance.

func (*MockClusters) AggregatedClusterNamespace added in v1.4.2

func (m *MockClusters) AggregatedClusterNamespace(arg0 RetentionResolution) (ClusterNamespace, bool)

AggregatedClusterNamespace mocks base method.

func (*MockClusters) Close added in v1.4.2

func (m *MockClusters) Close() error

Close mocks base method.

func (*MockClusters) ClusterNamespaces added in v1.4.2

func (m *MockClusters) ClusterNamespaces() ClusterNamespaces

ClusterNamespaces mocks base method.

func (*MockClusters) ConfigType added in v1.4.2

func (m *MockClusters) ConfigType() ClusterConfigType

ConfigType mocks base method.

func (*MockClusters) EXPECT added in v1.4.2

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClusters) NonReadyClusterNamespaces added in v1.4.2

func (m *MockClusters) NonReadyClusterNamespaces() ClusterNamespaces

NonReadyClusterNamespaces mocks base method.

func (*MockClusters) UnaggregatedClusterNamespace added in v1.4.2

func (m *MockClusters) UnaggregatedClusterNamespace() (ClusterNamespace, bool)

UnaggregatedClusterNamespace mocks base method.

type MockClustersMockRecorder added in v1.4.2

type MockClustersMockRecorder struct {
	// contains filtered or unexported fields
}

MockClustersMockRecorder is the mock recorder for MockClusters.

func (*MockClustersMockRecorder) AggregatedClusterNamespace added in v1.4.2

func (mr *MockClustersMockRecorder) AggregatedClusterNamespace(arg0 interface{}) *gomock.Call

AggregatedClusterNamespace indicates an expected call of AggregatedClusterNamespace.

func (*MockClustersMockRecorder) Close added in v1.4.2

func (mr *MockClustersMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockClustersMockRecorder) ClusterNamespaces added in v1.4.2

func (mr *MockClustersMockRecorder) ClusterNamespaces() *gomock.Call

ClusterNamespaces indicates an expected call of ClusterNamespaces.

func (*MockClustersMockRecorder) ConfigType added in v1.4.2

func (mr *MockClustersMockRecorder) ConfigType() *gomock.Call

ConfigType indicates an expected call of ConfigType.

func (*MockClustersMockRecorder) NonReadyClusterNamespaces added in v1.4.2

func (mr *MockClustersMockRecorder) NonReadyClusterNamespaces() *gomock.Call

NonReadyClusterNamespaces indicates an expected call of NonReadyClusterNamespaces.

func (*MockClustersMockRecorder) UnaggregatedClusterNamespace added in v1.4.2

func (mr *MockClustersMockRecorder) UnaggregatedClusterNamespace() *gomock.Call

UnaggregatedClusterNamespace indicates an expected call of UnaggregatedClusterNamespace.

type MockStorage added in v0.9.2

type MockStorage struct {
	// contains filtered or unexported fields
}

MockStorage is a mock of Storage interface.

func NewMockStorage added in v0.9.2

func NewMockStorage(ctrl *gomock.Controller) *MockStorage

NewMockStorage creates a new mock instance.

func (*MockStorage) Close added in v0.9.2

func (m *MockStorage) Close() error

Close mocks base method.

func (*MockStorage) CompleteTags added in v0.9.2

CompleteTags mocks base method.

func (*MockStorage) CompleteTagsCompressed added in v0.15.0

CompleteTagsCompressed mocks base method.

func (*MockStorage) EXPECT added in v0.9.2

func (m *MockStorage) EXPECT() *MockStorageMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockStorage) ErrorBehavior added in v0.13.0

func (m *MockStorage) ErrorBehavior() storage.ErrorBehavior

ErrorBehavior mocks base method.

func (*MockStorage) FetchBlocks added in v0.9.2

func (m *MockStorage) FetchBlocks(arg0 context.Context, arg1 *storage.FetchQuery, arg2 *storage.FetchOptions) (block.Result, error)

FetchBlocks mocks base method.

func (*MockStorage) FetchCompressed added in v0.9.2

FetchCompressed mocks base method.

func (*MockStorage) FetchCompressedResult added in v1.2.0

FetchCompressedResult mocks base method.

func (*MockStorage) FetchProm added in v0.15.0

FetchProm mocks base method.

func (*MockStorage) Name added in v0.13.0

func (m *MockStorage) Name() string

Name mocks base method.

func (*MockStorage) QueryStorageMetadataAttributes added in v1.2.0

func (m *MockStorage) QueryStorageMetadataAttributes(arg0 context.Context, arg1, arg2 time.Time, arg3 *storage.FetchOptions) ([]storagemetadata.Attributes, error)

QueryStorageMetadataAttributes mocks base method.

func (*MockStorage) SearchCompressed added in v0.9.2

SearchCompressed mocks base method.

func (*MockStorage) SearchSeries added in v0.9.2

func (m *MockStorage) SearchSeries(arg0 context.Context, arg1 *storage.FetchQuery, arg2 *storage.FetchOptions) (*storage.SearchResults, error)

SearchSeries mocks base method.

func (*MockStorage) Type added in v0.9.2

func (m *MockStorage) Type() storage.Type

Type mocks base method.

func (*MockStorage) Write added in v0.9.2

func (m *MockStorage) Write(arg0 context.Context, arg1 *storage.WriteQuery) error

Write mocks base method.

type MockStorageMockRecorder added in v0.9.2

type MockStorageMockRecorder struct {
	// contains filtered or unexported fields
}

MockStorageMockRecorder is the mock recorder for MockStorage.

func (*MockStorageMockRecorder) Close added in v0.9.2

func (mr *MockStorageMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockStorageMockRecorder) CompleteTags added in v0.9.2

func (mr *MockStorageMockRecorder) CompleteTags(arg0, arg1, arg2 interface{}) *gomock.Call

CompleteTags indicates an expected call of CompleteTags.

func (*MockStorageMockRecorder) CompleteTagsCompressed added in v0.15.0

func (mr *MockStorageMockRecorder) CompleteTagsCompressed(arg0, arg1, arg2 interface{}) *gomock.Call

CompleteTagsCompressed indicates an expected call of CompleteTagsCompressed.

func (*MockStorageMockRecorder) ErrorBehavior added in v0.13.0

func (mr *MockStorageMockRecorder) ErrorBehavior() *gomock.Call

ErrorBehavior indicates an expected call of ErrorBehavior.

func (*MockStorageMockRecorder) FetchBlocks added in v0.9.2

func (mr *MockStorageMockRecorder) FetchBlocks(arg0, arg1, arg2 interface{}) *gomock.Call

FetchBlocks indicates an expected call of FetchBlocks.

func (*MockStorageMockRecorder) FetchCompressed added in v0.9.2

func (mr *MockStorageMockRecorder) FetchCompressed(arg0, arg1, arg2 interface{}) *gomock.Call

FetchCompressed indicates an expected call of FetchCompressed.

func (*MockStorageMockRecorder) FetchCompressedResult added in v1.2.0

func (mr *MockStorageMockRecorder) FetchCompressedResult(arg0, arg1, arg2 interface{}) *gomock.Call

FetchCompressedResult indicates an expected call of FetchCompressedResult.

func (*MockStorageMockRecorder) FetchProm added in v0.15.0

func (mr *MockStorageMockRecorder) FetchProm(arg0, arg1, arg2 interface{}) *gomock.Call

FetchProm indicates an expected call of FetchProm.

func (*MockStorageMockRecorder) Name added in v0.13.0

func (mr *MockStorageMockRecorder) Name() *gomock.Call

Name indicates an expected call of Name.

func (*MockStorageMockRecorder) QueryStorageMetadataAttributes added in v1.2.0

func (mr *MockStorageMockRecorder) QueryStorageMetadataAttributes(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

QueryStorageMetadataAttributes indicates an expected call of QueryStorageMetadataAttributes.

func (*MockStorageMockRecorder) SearchCompressed added in v0.9.2

func (mr *MockStorageMockRecorder) SearchCompressed(arg0, arg1, arg2 interface{}) *gomock.Call

SearchCompressed indicates an expected call of SearchCompressed.

func (*MockStorageMockRecorder) SearchSeries added in v0.9.2

func (mr *MockStorageMockRecorder) SearchSeries(arg0, arg1, arg2 interface{}) *gomock.Call

SearchSeries indicates an expected call of SearchSeries.

func (*MockStorageMockRecorder) Type added in v0.9.2

func (mr *MockStorageMockRecorder) Type() *gomock.Call

Type indicates an expected call of Type.

func (*MockStorageMockRecorder) Write added in v0.9.2

func (mr *MockStorageMockRecorder) Write(arg0, arg1 interface{}) *gomock.Call

Write indicates an expected call of Write.

type NewClientFromConfig

type NewClientFromConfig func(
	cfg client.Configuration,
	params client.ConfigurationParameters,
	custom ...client.CustomAdminOption,
) (client.Client, error)

NewClientFromConfig is a method that can be set on ClusterStaticConfiguration to allow overriding the client initialization.

type Options added in v1.2.0

type Options interface {
	// SetSplitSeriesByBlock determines if the converter will split the series
	// by blocks, or if it will instead treat the entire series as a single block.
	SetSplitSeriesByBlock(bool) Options
	// SplittingSeriesByBlock returns true iff lookback duration is 0, and the
	// options has not been forced to return a single block.
	SplittingSeriesByBlock() bool
	// SetLookbackDuration sets the lookback duration.
	SetLookbackDuration(time.Duration) Options
	// LookbackDuration returns the lookback duration.
	LookbackDuration() time.Duration
	// SetConsolidationFunc sets the consolidation function for the converter.
	SetConsolidationFunc(consolidators.ConsolidationFunc) Options
	// ConsolidationFunc returns the consolidation function.
	ConsolidationFunc() consolidators.ConsolidationFunc
	// SetTagOptions sets the tag options for the converter.
	SetTagOptions(models.TagOptions) Options
	// TagOptions returns the tag options.
	TagOptions() models.TagOptions
	// TagsTransform returns the transform to apply to tags before storage.
	TagsTransform() TagsTransform
	// SetTagsTransform sets the TagsTransform.
	SetTagsTransform(value TagsTransform) Options
	// SetRateLimiter sets the RateLimiter
	SetRateLimiter(value RateLimiter) Options
	// RateLimiter returns the rate limiter.
	RateLimiter() RateLimiter
	// SetIteratorPools sets the iterator pools for the converter.
	SetIteratorPools(encoding.IteratorPools) Options
	// IteratorPools returns the iterator pools for the converter.
	IteratorPools() encoding.IteratorPools
	// SetCheckedBytesPool sets the checked bytes pool for the converter.
	SetCheckedBytesPool(pool.CheckedBytesPool) Options
	// CheckedBytesPool returns the checked bytes pools for the converter.
	CheckedBytesPool() pool.CheckedBytesPool
	// SetReadWorkerPool sets the read worker pool for the converter.
	SetReadWorkerPool(sync.PooledWorkerPool) Options
	// ReadWorkerPool returns the read worker pool for the converter.
	ReadWorkerPool() sync.PooledWorkerPool
	// SetWriteWorkerPool sets the write worker pool for the converter.
	SetWriteWorkerPool(sync.PooledWorkerPool) Options
	// WriteWorkerPool returns the write worker pool for the converter.
	WriteWorkerPool() sync.PooledWorkerPool
	// SetSeriesConsolidationMatchOptions sets series consolidation options.
	SetSeriesConsolidationMatchOptions(value consolidators.MatchOptions) Options
	// SeriesConsolidationMatchOptions sets series consolidation options.
	SeriesConsolidationMatchOptions() consolidators.MatchOptions
	// SetSeriesIteratorProcessor sets the series iterator processor.
	SetSeriesIteratorProcessor(SeriesIteratorProcessor) Options
	// SeriesIteratorProcessor returns the series iterator processor.
	SeriesIteratorProcessor() SeriesIteratorProcessor
	// SetIteratorBatchingFn sets the batching function for the converter.
	SetIteratorBatchingFn(IteratorBatchingFn) Options
	// IteratorBatchingFn returns the batching function for the converter.
	IteratorBatchingFn() IteratorBatchingFn
	// SetBlockSeriesProcessor set the block series processor.
	SetBlockSeriesProcessor(value BlockSeriesProcessor) Options
	// BlockSeriesProcessor returns the block series processor.
	BlockSeriesProcessor() BlockSeriesProcessor
	// SetCustomAdminOptions sets custom admin options.
	SetCustomAdminOptions([]client.CustomAdminOption) Options
	// CustomAdminOptions gets custom admin options.
	CustomAdminOptions() []client.CustomAdminOption
	// SetInstrumented marks if the encoding step should have instrumentation enabled.
	SetInstrumented(bool) Options
	// Instrumented returns if the encoding step should have instrumentation enabled.
	Instrumented() bool
	// SetPromConvertOptions sets options for converting raw series iterators
	// to a Prometheus-compatible result.
	SetPromConvertOptions(storage.PromConvertOptions) Options
	// PromConvertOptions returns options for converting raw series iterators
	// to a Prometheus-compatible result.
	PromConvertOptions() storage.PromConvertOptions
	// Validate ensures that the given block options are valid.
	Validate() error
}

Options describes the options for encoded block converters. These options are generally config-backed and don't usually change across queries, unless certain query string parameters are present.

func NewOptions added in v1.2.0

func NewOptions(encodingOpts encoding.Options) Options

NewOptions creates a default encoded block options which dictates how encoded blocks are generated.

type Querier

type Querier interface {
	// FetchCompressedResult fetches timeseries data based on a query.
	FetchCompressedResult(
		ctx context.Context,
		query *storage.FetchQuery,
		options *storage.FetchOptions,
	) (consolidators.SeriesFetchResult, Cleanup, error)

	// SearchCompressed fetches matching tags based on a query.
	SearchCompressed(
		ctx context.Context,
		query *storage.FetchQuery,
		options *storage.FetchOptions,
	) (consolidators.TagResult, Cleanup, error)

	// CompleteTagsCompressed returns autocompleted tag results.
	CompleteTagsCompressed(
		ctx context.Context,
		query *storage.CompleteTagsQuery,
		options *storage.FetchOptions,
	) (*consolidators.CompleteTagsResult, error)
}

Querier handles queries against an M3 instance.

type RateLimiter added in v1.4.2

type RateLimiter interface {
	// Limit returns a boolean indicating whether or not the storage write may proceed.
	Limit(context.Context, ClusterNamespace, queryts.Datapoints, []models.Tag) bool
	Close() error
}

RateLimiter rate limits write requests to the db nodes.

type RetentionResolution

type RetentionResolution struct {
	Retention  time.Duration
	Resolution time.Duration
}

RetentionResolution is a tuple of retention and resolution that describes an aggregated metrics policy.

type SeriesIteratorProcessor added in v1.2.0

type SeriesIteratorProcessor interface {
	// InspectSeries inspects SeriesIterator slices for a given query.
	InspectSeries(
		ctx context.Context,
		query index.Query,
		queryOpts index.QueryOptions,
		seriesIterators []encoding.SeriesIterator,
	) error
}

SeriesIteratorProcessor optionally defines methods to process series iterators.

type Storage

type Storage interface {
	storage.Storage
	Querier
}

Storage provides an interface for reading and writing to the TSDB.

func NewStorage

func NewStorage(
	clusters Clusters,
	opts Options,
	instrumentOpts instrument.Options,
) (Storage, error)

NewStorage creates a new local m3storage instance.

type TagsTransform added in v1.2.0

type TagsTransform func(context.Context, ClusterNamespace, []models.Tag) ([]models.Tag, error)

TagsTransform transforms a set of tags.

type UnaggregatedClusterNamespaceDefinition

type UnaggregatedClusterNamespaceDefinition struct {
	NamespaceID ident.ID
	Session     client.Session
	Retention   time.Duration
}

UnaggregatedClusterNamespaceDefinition is the definition for the cluster namespace that holds unaggregated metrics data.

func (UnaggregatedClusterNamespaceDefinition) Validate

Validate will validate the cluster namespace definition.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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