m3

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: Apache-2.0 Imports: 31 Imported by: 11

Documentation

Overview

Package m3 is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchResultToBlockResult added in v0.15.0

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

FetchResultToBlockResult converts an encoded SeriesIterator fetch result into blocks.

Types

type AggregatedClusterNamespaceDefinition

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

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 Cleanup

type Cleanup func() error

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

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 (ClusterNamespaceOptions) Attributes

Attributes returns the storage attributes of the 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.

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 ClusterNamespacesByResolutionAsc added in v0.4.6

type ClusterNamespacesByResolutionAsc []ClusterNamespace

ClusterNamespacesByResolutionAsc is a slice of ClusterNamespace instances is sortable by resolution.

func (ClusterNamespacesByResolutionAsc) Len added in v0.4.6

func (ClusterNamespacesByResolutionAsc) Less added in v0.4.6

func (ClusterNamespacesByResolutionAsc) Swap added in v0.4.6

type ClusterNamespacesByRetentionAsc added in v0.4.6

type ClusterNamespacesByRetentionAsc []ClusterNamespace

ClusterNamespacesByRetentionAsc is a slice of ClusterNamespace instances is sortable by retention.

func (ClusterNamespacesByRetentionAsc) Len added in v0.4.6

func (ClusterNamespacesByRetentionAsc) Less added in v0.4.6

func (ClusterNamespacesByRetentionAsc) Swap added in v0.4.6

func (a ClusterNamespacesByRetentionAsc) Swap(i, j int)

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
	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"`
}

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

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
}

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

	// SetDynamicClusterNamespaceConfiguration 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 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) 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) 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) 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) 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 Querier

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

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

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

Querier handles queries against an M3 instance.

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 Storage

type Storage interface {
	genericstorage.Storage
	Querier
}

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

func NewStorage

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

NewStorage creates a new local m3storage instance.

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