downsample

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: Apache-2.0 Imports: 48 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 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 {
	// 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"`
}

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        []MappingRule
	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 MappingRule added in v0.4.4

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

MappingRule is a mapping rule to apply to metrics.

func (MappingRule) StagedMetadatas added in v0.4.4

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

StagedMetadatas returns the corresponding staged metadatas for this mapping rule.

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

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

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 []MappingRule
}

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

Jump to

Keyboard shortcuts

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