m3

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2019 License: Apache-2.0 Imports: 23 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountedSeriesIter added in v0.7.1

type AccountedSeriesIter struct {
	encoding.SeriesIterator
	// contains filtered or unexported fields
}

AccountedSeriesIter wraps a series iterator to track and enforce limits on datapoint usage. Datapoint usage is tracked on each call to Next().

func NewAccountedSeriesIter added in v0.7.1

func NewAccountedSeriesIter(wrapped encoding.SeriesIterator, enforcer cost.ChainedEnforcer, scope tally.Scope) *AccountedSeriesIter

NewAccountedSeriesIter constructs an AccountedSeriesIter which uses wrapped as its source.

func (*AccountedSeriesIter) Close added in v0.7.1

func (as *AccountedSeriesIter) Close()

Close closes the underlying iterator, and marks datapoints as released to our enforcer.

func (*AccountedSeriesIter) Err added in v0.7.1

func (as *AccountedSeriesIter) Err() error

Err returns the underlying iterator's error if present, or any limit exceeded error.

func (*AccountedSeriesIter) Next added in v0.7.1

func (as *AccountedSeriesIter) Next() bool

Next advances the underlying iterator and adds to the datapoint count. If that count exceeds the limit, it will set this iterator's error.

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 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 storage.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"`

	// StorageMetricsType is the namespace type.
	//
	// Deprecated: Use "Type" field when specifying config instead, it is
	// invalid to use both.
	StorageMetricsType storage.MetricsType `yaml:"storageMetricsType"`
}

ClusterStaticNamespaceConfiguration describes the namespaces in a static cluster.

type Clusters

type Clusters interface {
	io.Closer

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

	// UnaggregatedClusterNamespace returns the valid unaggregated
	// cluster namespace.
	UnaggregatedClusterNamespace() ClusterNamespace

	// 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.

type ClustersStaticConfiguration

type ClustersStaticConfiguration []ClusterStaticConfiguration

ClustersStaticConfiguration is a set of static cluster configurations.

func (ClustersStaticConfiguration) NewClusters

NewClusters instantiates a new Clusters instance.

type ClustersStaticConfigurationOptions

type ClustersStaticConfigurationOptions struct {
	AsyncSessions   bool
	ProvidedSession client.Session
}

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 MultiFetchResult added in v0.4.8

type MultiFetchResult interface {
	// Add adds series iterators with corresponding attributes to the accumulator.
	Add(
		attrs genericstorage.Attributes,
		iterators encoding.SeriesIterators,
		err error,
	)
	// FinalResult returns a series iterators object containing
	// deduplicated series values.
	FinalResult() (encoding.SeriesIterators, error)
	// FinalResultWithAttrs returns a series iterators object containing
	// deduplicated series values, attributes corresponding to these iterators,
	// and any errors encountered.
	FinalResultWithAttrs() (
		encoding.SeriesIterators, []genericstorage.Attributes, error)
	// Close releases all resources held by this accumulator.
	Close() error
}

MultiFetchResult is a deduping accumalator for series iterators that allows merging using a given strategy.

type MultiFetchTagsResult added in v0.4.8

type MultiFetchTagsResult interface {
	// Add adds tagged ID iterators to the accumulator
	Add(
		newIterator client.TaggedIDsIterator,
		err error,
	)
	// FinalResult returns a deduped list of tag iterators with
	// corresponding series ids
	FinalResult() ([]MultiTagResult, error)
	// Close releases all resources held by this accumulator
	Close() error
}

MultiFetchTagsResult is a deduping accumalator for tag iterators

func NewMultiFetchTagsResult added in v0.4.8

func NewMultiFetchTagsResult() MultiFetchTagsResult

NewMultiFetchTagsResult builds a new multi fetch tags result

type MultiTagResult added in v0.4.8

type MultiTagResult struct {
	// ID is the series ID
	ID ident.ID
	// Iter is the tag iterator for the series
	Iter ident.TagIterator
}

MultiTagResult represents a tag iterator with its string ID

type NewClientFromConfig

type NewClientFromConfig func(
	cfg client.Configuration,
	params client.ConfigurationParameters,
	custom ...client.CustomOption,
) (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,
	) (encoding.SeriesIterators, Cleanup, error)
	// SearchCompressed fetches matching tags based on a query
	SearchCompressed(
		ctx context.Context,
		query *genericstorage.FetchQuery,
		options *genericstorage.FetchOptions,
	) ([]MultiTagResult, Cleanup, 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,
	readWorkerPool xsync.PooledWorkerPool,
	writeWorkerPool xsync.PooledWorkerPool,
	tagOptions models.TagOptions,
	lookbackDuration time.Duration,
) (Storage, error)

NewStorage creates a new local m3storage instance. TODO: consider taking in an iterator pools here.

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.

Jump to

Keyboard shortcuts

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