downsample

package
Version: v0.0.0-...-9649366 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: Apache-2.0 Imports: 48 Imported by: 0

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

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

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

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

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

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

MappingRule is a mapping rule to apply to metrics.

func (MappingRule) StagedMetadatas

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

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

MockDownsampler is a mock of Downsampler interface

func NewMockDownsampler

func NewMockDownsampler(ctrl *gomock.Controller) *MockDownsampler

NewMockDownsampler creates a new mock instance

func (*MockDownsampler) EXPECT

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

func (*MockDownsampler) NewMetricsAppender

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

NewMetricsAppender mocks base method

type MockDownsamplerMockRecorder

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

MockDownsamplerMockRecorder is the mock recorder for MockDownsampler

func (*MockDownsamplerMockRecorder) NewMetricsAppender

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

NewMetricsAppender indicates an expected call of NewMetricsAppender

type MockMetricsAppender

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

MockMetricsAppender is a mock of MetricsAppender interface

func NewMockMetricsAppender

func NewMockMetricsAppender(ctrl *gomock.Controller) *MockMetricsAppender

NewMockMetricsAppender creates a new mock instance

func (*MockMetricsAppender) AddTag

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

AddTag mocks base method

func (*MockMetricsAppender) EXPECT

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

func (*MockMetricsAppender) Finalize

func (m *MockMetricsAppender) Finalize()

Finalize mocks base method

func (*MockMetricsAppender) Reset

func (m *MockMetricsAppender) Reset()

Reset mocks base method

func (*MockMetricsAppender) SamplesAppender

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

SamplesAppender mocks base method

type MockMetricsAppenderMockRecorder

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

MockMetricsAppenderMockRecorder is the mock recorder for MockMetricsAppender

func (*MockMetricsAppenderMockRecorder) AddTag

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

AddTag indicates an expected call of AddTag

func (*MockMetricsAppenderMockRecorder) Finalize

Finalize indicates an expected call of Finalize

func (*MockMetricsAppenderMockRecorder) Reset

Reset indicates an expected call of Reset

func (*MockMetricsAppenderMockRecorder) SamplesAppender

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

SamplesAppender indicates an expected call of SamplesAppender

type MockSamplesAppender

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

MockSamplesAppender is a mock of SamplesAppender interface

func NewMockSamplesAppender

func NewMockSamplesAppender(ctrl *gomock.Controller) *MockSamplesAppender

NewMockSamplesAppender creates a new mock instance

func (*MockSamplesAppender) AppendCounterSample

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

AppendCounterSample mocks base method

func (*MockSamplesAppender) AppendCounterTimedSample

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

AppendCounterTimedSample mocks base method

func (*MockSamplesAppender) AppendGaugeSample

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

AppendGaugeSample mocks base method

func (*MockSamplesAppender) AppendGaugeTimedSample

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

AppendGaugeTimedSample mocks base method

func (*MockSamplesAppender) EXPECT

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

type MockSamplesAppenderMockRecorder

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

MockSamplesAppenderMockRecorder is the mock recorder for MockSamplesAppender

func (*MockSamplesAppenderMockRecorder) AppendCounterSample

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

AppendCounterSample indicates an expected call of AppendCounterSample

func (*MockSamplesAppenderMockRecorder) AppendCounterTimedSample

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

AppendCounterTimedSample indicates an expected call of AppendCounterTimedSample

func (*MockSamplesAppenderMockRecorder) AppendGaugeSample

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

AppendGaugeSample indicates an expected call of AppendGaugeSample

func (*MockSamplesAppenderMockRecorder) AppendGaugeTimedSample

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

AppendGaugeTimedSample indicates an expected call of AppendGaugeTimedSample

type NewDownsamplerFn

type NewDownsamplerFn func() (Downsampler, error)

NewDownsamplerFn creates a downsampler.

type RemoteAggregatorConfiguration

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

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

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
t or T : Toggle theme light dark auto
y or Y : Canonical URL