downsample

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: Apache-2.0 Imports: 62 Imported by: 8

Documentation

Overview

Package downsample is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// MetricsOptionIDSchemeTagName is a meta tag
	// that describes the ID should use a specific ID scheme.
	MetricsOptionIDSchemeTagName = []byte("__option_id_scheme__")
	// GraphiteIDSchemeTagValue specifies that the graphite ID
	// scheme should be used for a metric.
	GraphiteIDSchemeTagValue = []byte("graphite")
)

Functions

This section is empty.

Types

type AggregateOperationConfiguration added in v0.15.0

type AggregateOperationConfiguration struct {
	// Type is an aggregation operation type.
	Type aggregation.Type `yaml:"type"`
}

AggregateOperationConfiguration is an aggregate operation.

type AggregationTypes added in v0.15.0

type AggregationTypes []aggregation.Type

AggregationTypes is a set of aggregation types.

func (AggregationTypes) Proto added in v0.15.0

Proto returns a set of aggregation types as their protobuf value.

type AutoMappingRule added in v0.15.0

type AutoMappingRule struct {
	Aggregations []aggregation.Type
	Policies     policy.StoragePolicies
}

AutoMappingRule is a mapping rule to apply to metrics.

func (AutoMappingRule) StagedMetadatas added in v0.15.0

func (r AutoMappingRule) StagedMetadatas() (metadata.StagedMetadatas, error)

StagedMetadatas returns the corresponding staged metadatas for this mapping rule.

type BufferPastLimitConfiguration added in v0.10.2

type BufferPastLimitConfiguration struct {
	Resolution time.Duration `yaml:"resolution"`
	BufferPast time.Duration `yaml:"bufferPast"`
}

BufferPastLimitConfiguration specifies a custom buffer past limit for aggregation tiles.

type Configuration added in v0.4.8

type Configuration struct {
	// Matcher is the configuration for the downsampler matcher.
	Matcher MatcherConfiguration `yaml:"matcher"`

	// Rules is a set of downsample rules. If set, this overrides any rules set
	// in the KV store (and the rules in KV store are not evaluated at all).
	Rules *RulesConfiguration `yaml:"rules"`

	// RemoteAggregator specifies that downsampling should be done remotely
	// by sending values to a remote m3aggregator cluster which then
	// can forward the aggregated values to stateless m3coordinator backends.
	RemoteAggregator *RemoteAggregatorConfiguration `yaml:"remoteAggregator"`

	// AggregationTypes configs the aggregation types.
	AggregationTypes *aggregation.TypesConfiguration `yaml:"aggregationTypes"`

	// Pool of counter elements.
	CounterElemPool pool.ObjectPoolConfiguration `yaml:"counterElemPool"`

	// Pool of timer elements.
	TimerElemPool pool.ObjectPoolConfiguration `yaml:"timerElemPool"`

	// Pool of gauge elements.
	GaugeElemPool pool.ObjectPoolConfiguration `yaml:"gaugeElemPool"`

	// BufferPastLimits specifies the buffer past limits.
	BufferPastLimits []BufferPastLimitConfiguration `yaml:"bufferPastLimits"`

	// EntryTTL determines how long an entry remains alive before it may be expired due to inactivity.
	EntryTTL time.Duration `yaml:"entryTTL"`
}

Configuration configurates a downsampler.

func (Configuration) NewDownsampler added in v0.4.8

func (cfg Configuration) NewDownsampler(
	opts DownsamplerOptions,
) (Downsampler, error)

NewDownsampler returns a new downsampler.

type Downsampler

type Downsampler interface {
	NewMetricsAppender() (MetricsAppender, error)
}

Downsampler is a downsampler.

func NewAsyncDownsampler added in v0.5.0

func NewAsyncDownsampler(
	fn NewDownsamplerFn,
	done chan<- struct{},
) Downsampler

NewAsyncDownsampler is a downsampler that is lazily initialized.

type DownsamplerOptions

type DownsamplerOptions struct {
	Storage                 storage.Storage
	StorageFlushConcurrency int
	ClusterClient           clusterclient.Client
	RulesKVStore            kv.Store
	AutoMappingRules        []AutoMappingRule
	NameTag                 string
	ClockOptions            clock.Options
	InstrumentOptions       instrument.Options
	TagEncoderOptions       serialize.TagEncoderOptions
	TagDecoderOptions       serialize.TagDecoderOptions
	TagEncoderPoolOptions   pool.ObjectPoolOptions
	TagDecoderPoolOptions   pool.ObjectPoolOptions
	OpenTimeout             time.Duration
	TagOptions              models.TagOptions
}

DownsamplerOptions is a set of required downsampler options.

type MappingRuleConfiguration added in v0.15.0

type MappingRuleConfiguration struct {
	// Filter is a string separated filter of label name to label value
	// glob patterns to filter the mapping rule to.
	// e.g. "app:*nginx* foo:bar baz:qux*qaz*"
	Filter string `yaml:"filter"`

	// Aggregations is the aggregations to apply to the set of metrics.
	// One of:
	// - "Last"
	// - "Min"
	// - "Max"
	// - "Mean"
	// - "Median"
	// - "Count"
	// - "Sum"
	// - "SumSq"
	// - "Stdev"
	// - "P10"
	// - "P20"
	// - "P30"
	// - "P40"
	// - "P50"
	// - "P60"
	// - "P70"
	// - "P80"
	// - "P90"
	// - "P95"
	// - "P99"
	// - "P999"
	// - "P9999"
	Aggregations []aggregation.Type `yaml:"aggregations"`

	// StoragePolicies are retention/resolution storage policies at which to
	// keep matched metrics.
	StoragePolicies []StoragePolicyConfiguration `yaml:"storagePolicies"`

	// Drop specifies to drop any metrics that match the filter rather than
	// keeping them with a storage policy.
	Drop bool `yaml:"drop"`

	// Name is optional.
	Name string `yaml:"name"`
}

MappingRuleConfiguration is a mapping rule configuration.

func (MappingRuleConfiguration) Rule added in v0.15.0

Rule returns the mapping rule for the mapping rule configuration.

type MatcherCacheConfiguration added in v0.15.0

type MatcherCacheConfiguration struct {
	// Capacity if non-zero will set the capacity of the rules matching cache.
	Capacity int `yaml:"capacity"`
}

MatcherCacheConfiguration is the configuration for the rule matcher cache.

type MatcherConfiguration added in v0.15.0

type MatcherConfiguration struct {
	// Cache if non-zero will set the capacity of the rules matching cache.
	Cache MatcherCacheConfiguration `yaml:"cache"`
}

MatcherConfiguration is the configuration for the rule matcher.

type MetricsAppender

type MetricsAppender interface {
	AddTag(name, value []byte)
	SamplesAppender(opts SampleAppenderOptions) (SamplesAppender, error)
	Reset()
	Finalize()
}

MetricsAppender is a metrics appender that can build a samples appender, only valid to use with a single caller at a time.

type MockDownsampler added in v0.5.0

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

MockDownsampler is a mock of Downsampler interface

func NewMockDownsampler added in v0.5.0

func NewMockDownsampler(ctrl *gomock.Controller) *MockDownsampler

NewMockDownsampler creates a new mock instance

func (*MockDownsampler) EXPECT added in v0.5.0

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

func (*MockDownsampler) NewMetricsAppender added in v0.5.0

func (m *MockDownsampler) NewMetricsAppender() (MetricsAppender, error)

NewMetricsAppender mocks base method

type MockDownsamplerMockRecorder added in v0.5.0

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

MockDownsamplerMockRecorder is the mock recorder for MockDownsampler

func (*MockDownsamplerMockRecorder) NewMetricsAppender added in v0.5.0

func (mr *MockDownsamplerMockRecorder) NewMetricsAppender() *gomock.Call

NewMetricsAppender indicates an expected call of NewMetricsAppender

type MockMetricsAppender added in v0.5.0

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

MockMetricsAppender is a mock of MetricsAppender interface

func NewMockMetricsAppender added in v0.5.0

func NewMockMetricsAppender(ctrl *gomock.Controller) *MockMetricsAppender

NewMockMetricsAppender creates a new mock instance

func (*MockMetricsAppender) AddTag added in v0.5.0

func (m *MockMetricsAppender) AddTag(arg0, arg1 []byte)

AddTag mocks base method

func (*MockMetricsAppender) EXPECT added in v0.5.0

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

func (*MockMetricsAppender) Finalize added in v0.5.0

func (m *MockMetricsAppender) Finalize()

Finalize mocks base method

func (*MockMetricsAppender) Reset added in v0.5.0

func (m *MockMetricsAppender) Reset()

Reset mocks base method

func (*MockMetricsAppender) SamplesAppender added in v0.5.0

func (m *MockMetricsAppender) SamplesAppender(arg0 SampleAppenderOptions) (SamplesAppender, error)

SamplesAppender mocks base method

type MockMetricsAppenderMockRecorder added in v0.5.0

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

MockMetricsAppenderMockRecorder is the mock recorder for MockMetricsAppender

func (*MockMetricsAppenderMockRecorder) AddTag added in v0.5.0

func (mr *MockMetricsAppenderMockRecorder) AddTag(arg0, arg1 interface{}) *gomock.Call

AddTag indicates an expected call of AddTag

func (*MockMetricsAppenderMockRecorder) Finalize added in v0.5.0

Finalize indicates an expected call of Finalize

func (*MockMetricsAppenderMockRecorder) Reset added in v0.5.0

Reset indicates an expected call of Reset

func (*MockMetricsAppenderMockRecorder) SamplesAppender added in v0.5.0

func (mr *MockMetricsAppenderMockRecorder) SamplesAppender(arg0 interface{}) *gomock.Call

SamplesAppender indicates an expected call of SamplesAppender

type MockSamplesAppender added in v0.5.0

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

MockSamplesAppender is a mock of SamplesAppender interface

func NewMockSamplesAppender added in v0.5.0

func NewMockSamplesAppender(ctrl *gomock.Controller) *MockSamplesAppender

NewMockSamplesAppender creates a new mock instance

func (*MockSamplesAppender) AppendCounterSample added in v0.5.0

func (m *MockSamplesAppender) AppendCounterSample(arg0 int64) error

AppendCounterSample mocks base method

func (*MockSamplesAppender) AppendCounterTimedSample added in v0.5.0

func (m *MockSamplesAppender) AppendCounterTimedSample(arg0 time.Time, arg1 int64) error

AppendCounterTimedSample mocks base method

func (*MockSamplesAppender) AppendGaugeSample added in v0.5.0

func (m *MockSamplesAppender) AppendGaugeSample(arg0 float64) error

AppendGaugeSample mocks base method

func (*MockSamplesAppender) AppendGaugeTimedSample added in v0.5.0

func (m *MockSamplesAppender) AppendGaugeTimedSample(arg0 time.Time, arg1 float64) error

AppendGaugeTimedSample mocks base method

func (*MockSamplesAppender) AppendTimerTimedSample added in v0.15.0

func (m *MockSamplesAppender) AppendTimerTimedSample(arg0 time.Time, arg1 float64) error

AppendTimerTimedSample mocks base method

func (*MockSamplesAppender) EXPECT added in v0.5.0

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

type MockSamplesAppenderMockRecorder added in v0.5.0

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

MockSamplesAppenderMockRecorder is the mock recorder for MockSamplesAppender

func (*MockSamplesAppenderMockRecorder) AppendCounterSample added in v0.5.0

func (mr *MockSamplesAppenderMockRecorder) AppendCounterSample(arg0 interface{}) *gomock.Call

AppendCounterSample indicates an expected call of AppendCounterSample

func (*MockSamplesAppenderMockRecorder) AppendCounterTimedSample added in v0.5.0

func (mr *MockSamplesAppenderMockRecorder) AppendCounterTimedSample(arg0, arg1 interface{}) *gomock.Call

AppendCounterTimedSample indicates an expected call of AppendCounterTimedSample

func (*MockSamplesAppenderMockRecorder) AppendGaugeSample added in v0.5.0

func (mr *MockSamplesAppenderMockRecorder) AppendGaugeSample(arg0 interface{}) *gomock.Call

AppendGaugeSample indicates an expected call of AppendGaugeSample

func (*MockSamplesAppenderMockRecorder) AppendGaugeTimedSample added in v0.5.0

func (mr *MockSamplesAppenderMockRecorder) AppendGaugeTimedSample(arg0, arg1 interface{}) *gomock.Call

AppendGaugeTimedSample indicates an expected call of AppendGaugeTimedSample

func (*MockSamplesAppenderMockRecorder) AppendTimerTimedSample added in v0.15.0

func (mr *MockSamplesAppenderMockRecorder) AppendTimerTimedSample(arg0, arg1 interface{}) *gomock.Call

AppendTimerTimedSample indicates an expected call of AppendTimerTimedSample

type NewDownsamplerFn added in v0.5.0

type NewDownsamplerFn func() (Downsampler, error)

NewDownsamplerFn creates a downsampler.

type RemoteAggregatorConfiguration added in v0.8.0

type RemoteAggregatorConfiguration struct {
	// Client is the remote aggregator client.
	Client client.Configuration `yaml:"client"`
	// contains filtered or unexported fields
}

RemoteAggregatorConfiguration specifies a remote aggregator to use for downsampling.

type RollupOperationConfiguration added in v0.15.0

type RollupOperationConfiguration struct {
	// MetricName is the name of the new metric that is emitted after
	// the rollup is applied with its aggregations and group by's.
	MetricName string `yaml:"metricName"`

	// GroupBy is a set of labels to group by, only these remain on the
	// new metric name produced by the rollup operation.
	GroupBy []string `yaml:"groupBy"`

	// Aggregations is a set of aggregate operations to perform.
	Aggregations []aggregation.Type `yaml:"aggregations"`
}

RollupOperationConfiguration is a rollup operation.

type RollupRuleConfiguration added in v0.15.0

type RollupRuleConfiguration struct {
	// Filter is a space separated filter of label name to label value glob
	// patterns to which to filter the mapping rule.
	// e.g. "app:*nginx* foo:bar baz:qux*qaz*"
	Filter string `yaml:"filter"`

	// Transforms are a set of of rollup rule transforms.
	Transforms []TransformConfiguration `yaml:"transforms"`

	// StoragePolicies are retention/resolution storage policies at which to keep
	// the matched metrics.
	StoragePolicies []StoragePolicyConfiguration `yaml:"storagePolicies"`

	// Name is optional.
	Name string `yaml:"name"`
}

RollupRuleConfiguration is a rollup rule configuration.

func (RollupRuleConfiguration) Rule added in v0.15.0

Rule returns the rollup rule for the rollup rule configuration.

type RulesConfiguration added in v0.15.0

type RulesConfiguration struct {
	// MappingRules are mapping rules that set retention and resolution
	// for metrics given a filter to match metrics against.
	MappingRules []MappingRuleConfiguration `yaml:"mappingRules"`

	// RollupRules are rollup rules that sets specific aggregations for sets
	// of metrics given a filter to match metrics against.
	RollupRules []RollupRuleConfiguration `yaml:"rollupRules"`
}

RulesConfiguration is a set of rules configuration to use for downsampling.

type SampleAppenderOptions added in v0.5.0

type SampleAppenderOptions struct {
	Override      bool
	OverrideRules SamplesAppenderOverrideRules
}

SampleAppenderOptions defines the options being used when constructing the samples appender for a metric.

type SamplesAppender

type SamplesAppender interface {
	AppendCounterSample(value int64) error
	AppendGaugeSample(value float64) error
	AppendCounterTimedSample(t time.Time, value int64) error
	AppendGaugeTimedSample(t time.Time, value float64) error
	AppendTimerTimedSample(t time.Time, value float64) error
}

SamplesAppender is a downsampling samples appender, that can only be called by a single caller at a time.

type SamplesAppenderOverrideRules added in v0.5.0

type SamplesAppenderOverrideRules struct {
	MappingRules []AutoMappingRule
}

SamplesAppenderOverrideRules provides override rules to use instead of matching against default and dynamic matched rules for an ID.

type StoragePolicyConfiguration added in v0.15.0

type StoragePolicyConfiguration struct {
	Resolution time.Duration `yaml:"resolution"`
	Retention  time.Duration `yaml:"retention"`
}

StoragePolicyConfiguration is the storage policy to apply to a set of metrics.

func (StoragePolicyConfiguration) StoragePolicy added in v0.15.0

StoragePolicy returns the corresponding storage policy.

func (StoragePolicyConfiguration) String added in v0.15.0

type StoragePolicyConfigurations added in v0.15.0

type StoragePolicyConfigurations []StoragePolicyConfiguration

StoragePolicyConfigurations are a set of storage policy configurations.

func (StoragePolicyConfigurations) StoragePolicies added in v0.15.0

StoragePolicies returns storage policies.

type TransformConfiguration added in v0.15.0

type TransformConfiguration struct {
	Rollup    *RollupOperationConfiguration    `yaml:"rollup"`
	Aggregate *AggregateOperationConfiguration `yaml:"aggregate"`
	Transform *TransformOperationConfiguration `yaml:"transform"`
}

TransformConfiguration is a rollup rule transform operation, only one single operation is allowed to be specified on any one transform configuration.

type TransformOperationConfiguration added in v0.15.0

type TransformOperationConfiguration struct {
	// Type is a transformation operation type.
	Type transformation.Type `yaml:"type"`
}

TransformOperationConfiguration is a transform operation.

Jump to

Keyboard shortcuts

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