writer

package
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: 15 Imported by: 0

Documentation

Overview

Package writer is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStoragePolicyFilter

func NewStoragePolicyFilter(acceptedStoragePolicies []policy.StoragePolicy) producer.FilterFunc

NewStoragePolicyFilter creates a new storage policy based filter.

Types

type MockWriter

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

MockWriter is a mock of Writer interface

func NewMockWriter

func NewMockWriter(ctrl *gomock.Controller) *MockWriter

NewMockWriter creates a new mock instance

func (*MockWriter) Close

func (m *MockWriter) Close() error

Close mocks base method

func (*MockWriter) EXPECT

func (m *MockWriter) EXPECT() *MockWriterMockRecorder

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

func (*MockWriter) Flush

func (m *MockWriter) Flush() error

Flush mocks base method

func (*MockWriter) Write

Write mocks base method

type MockWriterMockRecorder

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

MockWriterMockRecorder is the mock recorder for MockWriter

func (*MockWriterMockRecorder) Close

func (mr *MockWriterMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close

func (*MockWriterMockRecorder) Flush

func (mr *MockWriterMockRecorder) Flush() *gomock.Call

Flush indicates an expected call of Flush

func (*MockWriterMockRecorder) Write

func (mr *MockWriterMockRecorder) Write(arg0 interface{}) *gomock.Call

Write indicates an expected call of Write

type Options

type Options interface {
	// SetClockOptions sets the clock options.
	SetClockOptions(value clock.Options) Options

	// ClockOptions returns the clock options.
	ClockOptions() clock.Options

	// SetInstrumentOptions sets the instrument options.
	SetInstrumentOptions(value instrument.Options) Options

	// InstrumentOptions returns the instrument options.
	InstrumentOptions() instrument.Options

	// SetBytesPool sets the bytes pool.
	SetBytesPool(value pool.BytesPool) Options

	// BytesPool returns the bytes pool.
	BytesPool() pool.BytesPool

	// SetEncodingTimeSampleRate sets the sampling rate at which the encoding time is
	// included in the encoded data. A value of 0 means the encoding time is never included,
	// and a value of 1 means the encoding time is always included.
	SetEncodingTimeSamplingRate(value float64) Options

	// EncodingTimeSamplingRate returns the sampling rate at which the encoding time is
	// included in the encoded data. A value of 0 means the encoding time is never included,
	// and a value of 1 means the encoding time is always included.
	EncodingTimeSamplingRate() float64
}

Options provide a set of options for the writer.

func NewOptions

func NewOptions() Options

NewOptions provide a set of writer options.

type Writer

type Writer interface {
	// Write writes an aggregated metric alongside its storage policy.
	Write(mp aggregated.ChunkedMetricWithStoragePolicy) error

	// Flush flushes data buffered in the writer to backend.
	Flush() error

	// Close closes the writer.
	Close() error
}

Writer writes aggregated metrics alongside their policies.

func NewBlackholeWriter

func NewBlackholeWriter() Writer

NewBlackholeWriter creates a new blackhole writer.

func NewLoggingWriter

func NewLoggingWriter(logger *zap.Logger) Writer

NewLoggingWriter creates a new logging writer.

func NewMultiWriter

func NewMultiWriter(writers []Writer) Writer

NewMultiWriter creates a new multi-writer.

func NewProtobufWriter

func NewProtobufWriter(
	producer producer.Producer,
	shardFn sharding.ShardFn,
	opts Options,
) Writer

NewProtobufWriter creates a writer that encodes metric in protobuf.

Jump to

Keyboard shortcuts

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