client

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 39 Imported by: 14

Documentation

Overview

Package client is a generated GoMock package.

Package client is a generated GoMock package.

Package client is a generated GoMock package.

Package client is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminClient

type AdminClient interface {
	Client

	// WriteForwarded writes forwarded metrics.
	WriteForwarded(
		metric aggregated.ForwardedMetric,
		metadata metadata.ForwardMetadata,
	) error
}

AdminClient is an administrative client capable of performing regular client operations as well as high-privilege operations such as internal communcations among aggregation servers that regular client is not permissioned to do.

type AggregatorClientType added in v0.15.0

type AggregatorClientType int

AggregatorClientType determines the aggregator client type.

const (
	// LegacyAggregatorClient is an alias for TCPAggregatorClient
	LegacyAggregatorClient AggregatorClientType = iota
	// M3MsgAggregatorClient is the M3Msg aggregator client type that uses M3Msg to
	// handle publishing to a M3Msg topic the aggregator consumes from.
	M3MsgAggregatorClient
	// TCPAggregatorClient is the TCP aggregator client type and uses it's own
	// TCP negotiation, load balancing and data transmission protocol.
	TCPAggregatorClient
)

func (AggregatorClientType) MarshalYAML added in v1.4.2

func (t AggregatorClientType) MarshalYAML() (interface{}, error)

MarshalYAML returns the YAML representation of the AggregatorClientType.

func (AggregatorClientType) String added in v0.15.0

func (t AggregatorClientType) String() string

func (*AggregatorClientType) UnmarshalYAML added in v0.15.0

func (t *AggregatorClientType) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals a AggregatorClientType into a valid type from string.

type Client

type Client interface {
	// Init initializes the client.
	Init() error

	// WriteUntimedCounter writes untimed counter metrics.
	WriteUntimedCounter(
		counter unaggregated.Counter,
		metadatas metadata.StagedMetadatas,
	) error

	// WriteUntimedBatchTimer writes untimed batch timer metrics.
	WriteUntimedBatchTimer(
		batchTimer unaggregated.BatchTimer,
		metadatas metadata.StagedMetadatas,
	) error

	// WriteUntimedGauge writes untimed gauge metrics.
	WriteUntimedGauge(
		gauge unaggregated.Gauge,
		metadatas metadata.StagedMetadatas,
	) error

	// WriteTimed writes timed metrics.
	WriteTimed(
		metric aggregated.Metric,
		metadata metadata.TimedMetadata,
	) error

	// WritePassthrough writes passthrough metrics.
	WritePassthrough(
		metric aggregated.Metric,
		storagePolicy policy.StoragePolicy,
	) error

	// WriteTimedWithStagedMetadatas writes timed metrics with staged metadatas.
	WriteTimedWithStagedMetadatas(
		metric aggregated.Metric,
		metadatas metadata.StagedMetadatas,
	) error

	// Flush flushes any remaining data buffered by the client.
	Flush() error

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

Client is a client capable of writing different types of metrics to the aggregation clients.

func NewClient

func NewClient(opts Options) (Client, error)

NewClient creates a new client.

func NewM3MsgClient added in v1.0.1

func NewM3MsgClient(opts Options) (Client, error)

NewM3MsgClient creates a new M3 Aggregator client that uses M3Msg.

type Configuration

type Configuration struct {
	Type                       AggregatorClientType            `yaml:"type"`
	M3Msg                      *M3MsgConfiguration             `yaml:"m3msg"`
	PlacementKV                *kv.OverrideConfiguration       `yaml:"placementKV"`
	Watcher                    *placement.WatcherConfiguration `yaml:"placementWatcher"`
	HashType                   *sharding.HashType              `yaml:"hashType"`
	ShardCutoverWarmupDuration *time.Duration                  `yaml:"shardCutoverWarmupDuration"`
	ShardCutoffLingerDuration  *time.Duration                  `yaml:"shardCutoffLingerDuration"`
	Encoder                    EncoderConfiguration            `yaml:"encoder"`
	FlushSize                  int                             `yaml:"flushSize,omitempty"` // FlushSize is deprecated
	FlushWorkerCount           int                             `yaml:"flushWorkerCount"`
	ForceFlushEvery            time.Duration                   `yaml:"forceFlushEvery"`
	MaxBatchSize               int                             `yaml:"maxBatchSize"`
	MaxTimerBatchSize          int                             `yaml:"maxTimerBatchSize"`
	QueueSize                  int                             `yaml:"queueSize"`
	QueueDropType              *DropType                       `yaml:"queueDropType"`
	Connection                 ConnectionConfiguration         `yaml:"connection"`
}

Configuration contains client configuration.

func (*Configuration) NewAdminClient

func (c *Configuration) NewAdminClient(
	kvClient m3clusterclient.Client,
	clockOpts clock.Options,
	instrumentOpts instrument.Options,
	rwOpts xio.Options,
) (AdminClient, error)

NewAdminClient creates a new admin client.

func (*Configuration) NewClient

func (c *Configuration) NewClient(
	kvClient m3clusterclient.Client,
	clockOpts clock.Options,
	instrumentOpts instrument.Options,
	rwOpts xio.Options,
) (Client, error)

NewClient creates a new client.

type ConnectionConfiguration

type ConnectionConfiguration struct {
	ConnectionTimeout            time.Duration        `yaml:"connectionTimeout"`
	ConnectionKeepAlive          *bool                `yaml:"connectionKeepAlive"`
	WriteTimeout                 time.Duration        `yaml:"writeTimeout"`
	InitReconnectThreshold       int                  `yaml:"initReconnectThreshold"`
	MaxReconnectThreshold        int                  `yaml:"maxReconnectThreshold"`
	ReconnectThresholdMultiplier int                  `yaml:"reconnectThresholdMultiplier"`
	MaxReconnectDuration         *time.Duration       `yaml:"maxReconnectDuration"`
	WriteRetries                 *retry.Configuration `yaml:"writeRetries"`
}

ConnectionConfiguration contains the connection configuration.

func (*ConnectionConfiguration) NewConnectionOptions

func (c *ConnectionConfiguration) NewConnectionOptions(scope tally.Scope) ConnectionOptions

NewConnectionOptions creates new connection options.

type ConnectionOptions

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

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

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

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

	// SetConnectionTimeout sets the timeout for establishing connections.
	SetConnectionTimeout(value time.Duration) ConnectionOptions

	// ConnectionTimeout returns the timeout for establishing connections.
	ConnectionTimeout() time.Duration

	// SetConnectionKeepAlive sets the keepAlive for the connection.
	SetConnectionKeepAlive(value bool) ConnectionOptions

	// ConnectionKeepAlive returns the keepAlive for the connection.
	ConnectionKeepAlive() bool

	// SetWriteTimeout sets the timeout for writing data.
	SetWriteTimeout(value time.Duration) ConnectionOptions

	// WriteTimeout returns the timeout for writing data.
	WriteTimeout() time.Duration

	// SetInitReconnectThreshold sets the initial threshold for re-establshing connections.
	SetInitReconnectThreshold(value int) ConnectionOptions

	// InitReconnectThreshold returns the initial threshold for re-establishing connections.
	InitReconnectThreshold() int

	// SetMaxReconnectThreshold sets the max threshold for re-establishing connections.
	SetMaxReconnectThreshold(value int) ConnectionOptions

	// MaxReconnectThreshold returns the max threshold for re-establishing connections.
	MaxReconnectThreshold() int

	// SetReconnectThresholdMultiplier sets the threshold multiplier.
	SetReconnectThresholdMultiplier(value int) ConnectionOptions

	// ReconnectThresholdMultiplier returns the threshold multiplier.
	ReconnectThresholdMultiplier() int

	// SetMaxReconnectDuration sets the max duration between attempts to re-establish connections.
	SetMaxReconnectDuration(value time.Duration) ConnectionOptions

	// MaxReconnectDuration returns the max duration between attempts to re-establish connections.
	MaxReconnectDuration() time.Duration

	// SetWriteRetryOptions sets the retry options for retrying failed writes.
	SetWriteRetryOptions(value retry.Options) ConnectionOptions

	// WriteRetryOptions returns the retry options for retrying failed writes.
	WriteRetryOptions() retry.Options

	// SetRWOptions sets RW options.
	SetRWOptions(value xio.Options) ConnectionOptions

	// RWOptions returns the RW options.
	RWOptions() xio.Options
}

ConnectionOptions provides a set of options for tcp connections.

func NewConnectionOptions

func NewConnectionOptions() ConnectionOptions

NewConnectionOptions create a new set of connection options.

type DropType

type DropType int

DropType determines which metrics should be dropped when the queue is full.

const (
	// DropOldest signifies that the oldest metrics in the queue should be dropped.
	DropOldest DropType = iota

	// DropCurrent signifies that the current metrics in the queue should be dropped.
	DropCurrent
)

func (DropType) String

func (t DropType) String() string

func (*DropType) UnmarshalYAML

func (t *DropType) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals a DropType into a valid type from string.

type EncoderConfiguration

type EncoderConfiguration struct {
	InitBufferSize *int                              `yaml:"initBufferSize"`
	MaxMessageSize *int                              `yaml:"maxMessageSize"`
	BytesPool      *pool.BucketizedPoolConfiguration `yaml:"bytesPool"`
}

EncoderConfiguration configures the encoder.

func (*EncoderConfiguration) NewEncoderOptions

func (c *EncoderConfiguration) NewEncoderOptions(
	instrumentOpts instrument.Options,
) protobuf.UnaggregatedOptions

NewEncoderOptions create a new set of encoder options.

type M3MsgClient added in v1.0.1

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

M3MsgClient sends metrics to M3 Aggregator over m3msg.

func (*M3MsgClient) Close added in v1.0.1

func (c *M3MsgClient) Close() error

Close closes the client.

func (*M3MsgClient) Flush added in v1.0.1

func (c *M3MsgClient) Flush() error

Flush satisfies Client interface, as M3Msg client does not need explicit flushing.

func (*M3MsgClient) Init added in v1.0.1

func (c *M3MsgClient) Init() error

Init just satisfies Client interface, M3Msg client does not need explicit initialization.

func (*M3MsgClient) WriteForwarded added in v1.0.1

func (c *M3MsgClient) WriteForwarded(
	metric aggregated.ForwardedMetric,
	metadata metadata.ForwardMetadata,
) error

WriteForwarded writes forwarded metrics.

func (*M3MsgClient) WritePassthrough added in v1.0.1

func (c *M3MsgClient) WritePassthrough(
	metric aggregated.Metric,
	storagePolicy policy.StoragePolicy,
) error

WritePassthrough writes passthrough metrics.

func (*M3MsgClient) WriteTimed added in v1.0.1

func (c *M3MsgClient) WriteTimed(
	metric aggregated.Metric,
	metadata metadata.TimedMetadata,
) error

WriteTimed writes timed metrics.

func (*M3MsgClient) WriteTimedWithStagedMetadatas added in v1.0.1

func (c *M3MsgClient) WriteTimedWithStagedMetadatas(
	metric aggregated.Metric,
	metadatas metadata.StagedMetadatas,
) error

WriteTimedWithStagedMetadatas writes timed metrics with staged metadatas.

func (*M3MsgClient) WriteUntimedBatchTimer added in v1.0.1

func (c *M3MsgClient) WriteUntimedBatchTimer(
	batchTimer unaggregated.BatchTimer,
	metadatas metadata.StagedMetadatas,
) error

WriteUntimedBatchTimer writes untimed batch timer metrics.

func (*M3MsgClient) WriteUntimedCounter added in v1.0.1

func (c *M3MsgClient) WriteUntimedCounter(
	counter unaggregated.Counter,
	metadatas metadata.StagedMetadatas,
) error

WriteUntimedCounter writes untimed counter metrics.

func (*M3MsgClient) WriteUntimedGauge added in v1.0.1

func (c *M3MsgClient) WriteUntimedGauge(
	gauge unaggregated.Gauge,
	metadatas metadata.StagedMetadatas,
) error

WriteUntimedGauge writes untimed gauge metrics.

type M3MsgConfiguration added in v0.15.0

type M3MsgConfiguration struct {
	Producer producerconfig.ProducerConfiguration `yaml:"producer"`
}

M3MsgConfiguration contains the M3Msg client configuration, required if using M3Msg client type.

func (*M3MsgConfiguration) NewM3MsgOptions added in v0.15.0

func (c *M3MsgConfiguration) NewM3MsgOptions(
	kvClient m3clusterclient.Client,
	instrumentOpts instrument.Options,
	rwOpts xio.Options,
) (M3MsgOptions, error)

NewM3MsgOptions returns new M3Msg options from configuration.

type M3MsgOptions added in v0.15.0

type M3MsgOptions interface {
	// Validate validates the M3Msg client options.
	Validate() error

	// SetProducer sets the producer.
	SetProducer(value producer.Producer) M3MsgOptions

	// Producer gets the producer.
	Producer() producer.Producer

	// SetTimerOptions sets the instrument timer options.
	SetTimerOptions(value instrument.TimerOptions) M3MsgOptions

	// TimerOptions gets the instrument timer options.
	TimerOptions() instrument.TimerOptions
}

M3MsgOptions is a set of M3Msg client options.

func NewM3MsgOptions added in v0.15.0

func NewM3MsgOptions() M3MsgOptions

NewM3MsgOptions returns a new set of M3Msg options.

type MockAdminClient

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

MockAdminClient is a mock of AdminClient interface.

func NewMockAdminClient

func NewMockAdminClient(ctrl *gomock.Controller) *MockAdminClient

NewMockAdminClient creates a new mock instance.

func (*MockAdminClient) Close

func (m *MockAdminClient) Close() error

Close mocks base method.

func (*MockAdminClient) EXPECT

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

func (*MockAdminClient) Flush

func (m *MockAdminClient) Flush() error

Flush mocks base method.

func (*MockAdminClient) Init

func (m *MockAdminClient) Init() error

Init mocks base method.

func (*MockAdminClient) WriteForwarded

WriteForwarded mocks base method.

func (*MockAdminClient) WritePassthrough added in v0.15.0

func (m *MockAdminClient) WritePassthrough(arg0 aggregated.Metric, arg1 policy.StoragePolicy) error

WritePassthrough mocks base method.

func (*MockAdminClient) WriteTimed

func (m *MockAdminClient) WriteTimed(arg0 aggregated.Metric, arg1 metadata.TimedMetadata) error

WriteTimed mocks base method.

func (*MockAdminClient) WriteTimedWithStagedMetadatas added in v0.15.0

func (m *MockAdminClient) WriteTimedWithStagedMetadatas(arg0 aggregated.Metric, arg1 metadata.StagedMetadatas) error

WriteTimedWithStagedMetadatas mocks base method.

func (*MockAdminClient) WriteUntimedBatchTimer

func (m *MockAdminClient) WriteUntimedBatchTimer(arg0 unaggregated.BatchTimer, arg1 metadata.StagedMetadatas) error

WriteUntimedBatchTimer mocks base method.

func (*MockAdminClient) WriteUntimedCounter

func (m *MockAdminClient) WriteUntimedCounter(arg0 unaggregated.Counter, arg1 metadata.StagedMetadatas) error

WriteUntimedCounter mocks base method.

func (*MockAdminClient) WriteUntimedGauge

func (m *MockAdminClient) WriteUntimedGauge(arg0 unaggregated.Gauge, arg1 metadata.StagedMetadatas) error

WriteUntimedGauge mocks base method.

type MockAdminClientMockRecorder

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

MockAdminClientMockRecorder is the mock recorder for MockAdminClient.

func (*MockAdminClientMockRecorder) Close

Close indicates an expected call of Close.

func (*MockAdminClientMockRecorder) Flush

Flush indicates an expected call of Flush.

func (*MockAdminClientMockRecorder) Init

Init indicates an expected call of Init.

func (*MockAdminClientMockRecorder) WriteForwarded

func (mr *MockAdminClientMockRecorder) WriteForwarded(arg0, arg1 interface{}) *gomock.Call

WriteForwarded indicates an expected call of WriteForwarded.

func (*MockAdminClientMockRecorder) WritePassthrough added in v0.15.0

func (mr *MockAdminClientMockRecorder) WritePassthrough(arg0, arg1 interface{}) *gomock.Call

WritePassthrough indicates an expected call of WritePassthrough.

func (*MockAdminClientMockRecorder) WriteTimed

func (mr *MockAdminClientMockRecorder) WriteTimed(arg0, arg1 interface{}) *gomock.Call

WriteTimed indicates an expected call of WriteTimed.

func (*MockAdminClientMockRecorder) WriteTimedWithStagedMetadatas added in v0.15.0

func (mr *MockAdminClientMockRecorder) WriteTimedWithStagedMetadatas(arg0, arg1 interface{}) *gomock.Call

WriteTimedWithStagedMetadatas indicates an expected call of WriteTimedWithStagedMetadatas.

func (*MockAdminClientMockRecorder) WriteUntimedBatchTimer

func (mr *MockAdminClientMockRecorder) WriteUntimedBatchTimer(arg0, arg1 interface{}) *gomock.Call

WriteUntimedBatchTimer indicates an expected call of WriteUntimedBatchTimer.

func (*MockAdminClientMockRecorder) WriteUntimedCounter

func (mr *MockAdminClientMockRecorder) WriteUntimedCounter(arg0, arg1 interface{}) *gomock.Call

WriteUntimedCounter indicates an expected call of WriteUntimedCounter.

func (*MockAdminClientMockRecorder) WriteUntimedGauge

func (mr *MockAdminClientMockRecorder) WriteUntimedGauge(arg0, arg1 interface{}) *gomock.Call

WriteUntimedGauge indicates an expected call of WriteUntimedGauge.

type MockClient

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

MockClient is a mock of Client interface.

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) Close

func (m *MockClient) Close() error

Close mocks base method.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

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

func (*MockClient) Flush

func (m *MockClient) Flush() error

Flush mocks base method.

func (*MockClient) Init

func (m *MockClient) Init() error

Init mocks base method.

func (*MockClient) WritePassthrough added in v0.15.0

func (m *MockClient) WritePassthrough(arg0 aggregated.Metric, arg1 policy.StoragePolicy) error

WritePassthrough mocks base method.

func (*MockClient) WriteTimed

func (m *MockClient) WriteTimed(arg0 aggregated.Metric, arg1 metadata.TimedMetadata) error

WriteTimed mocks base method.

func (*MockClient) WriteTimedWithStagedMetadatas added in v0.15.0

func (m *MockClient) WriteTimedWithStagedMetadatas(arg0 aggregated.Metric, arg1 metadata.StagedMetadatas) error

WriteTimedWithStagedMetadatas mocks base method.

func (*MockClient) WriteUntimedBatchTimer

func (m *MockClient) WriteUntimedBatchTimer(arg0 unaggregated.BatchTimer, arg1 metadata.StagedMetadatas) error

WriteUntimedBatchTimer mocks base method.

func (*MockClient) WriteUntimedCounter

func (m *MockClient) WriteUntimedCounter(arg0 unaggregated.Counter, arg1 metadata.StagedMetadatas) error

WriteUntimedCounter mocks base method.

func (*MockClient) WriteUntimedGauge

func (m *MockClient) WriteUntimedGauge(arg0 unaggregated.Gauge, arg1 metadata.StagedMetadatas) error

WriteUntimedGauge mocks base method.

type MockClientMockRecorder

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) Close

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

Close indicates an expected call of Close.

func (*MockClientMockRecorder) Flush

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

Flush indicates an expected call of Flush.

func (*MockClientMockRecorder) Init

func (mr *MockClientMockRecorder) Init() *gomock.Call

Init indicates an expected call of Init.

func (*MockClientMockRecorder) WritePassthrough added in v0.15.0

func (mr *MockClientMockRecorder) WritePassthrough(arg0, arg1 interface{}) *gomock.Call

WritePassthrough indicates an expected call of WritePassthrough.

func (*MockClientMockRecorder) WriteTimed

func (mr *MockClientMockRecorder) WriteTimed(arg0, arg1 interface{}) *gomock.Call

WriteTimed indicates an expected call of WriteTimed.

func (*MockClientMockRecorder) WriteTimedWithStagedMetadatas added in v0.15.0

func (mr *MockClientMockRecorder) WriteTimedWithStagedMetadatas(arg0, arg1 interface{}) *gomock.Call

WriteTimedWithStagedMetadatas indicates an expected call of WriteTimedWithStagedMetadatas.

func (*MockClientMockRecorder) WriteUntimedBatchTimer

func (mr *MockClientMockRecorder) WriteUntimedBatchTimer(arg0, arg1 interface{}) *gomock.Call

WriteUntimedBatchTimer indicates an expected call of WriteUntimedBatchTimer.

func (*MockClientMockRecorder) WriteUntimedCounter

func (mr *MockClientMockRecorder) WriteUntimedCounter(arg0, arg1 interface{}) *gomock.Call

WriteUntimedCounter indicates an expected call of WriteUntimedCounter.

func (*MockClientMockRecorder) WriteUntimedGauge

func (mr *MockClientMockRecorder) WriteUntimedGauge(arg0, arg1 interface{}) *gomock.Call

WriteUntimedGauge indicates an expected call of WriteUntimedGauge.

type MockinstanceQueue

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

MockinstanceQueue is a mock of instanceQueue interface.

func NewMockinstanceQueue

func NewMockinstanceQueue(ctrl *gomock.Controller) *MockinstanceQueue

NewMockinstanceQueue creates a new mock instance.

func (*MockinstanceQueue) Close

func (m *MockinstanceQueue) Close() error

Close mocks base method.

func (*MockinstanceQueue) EXPECT

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

func (*MockinstanceQueue) Enqueue

func (m *MockinstanceQueue) Enqueue(buf protobuf.Buffer) error

Enqueue mocks base method.

func (*MockinstanceQueue) Flush added in v1.2.0

func (m *MockinstanceQueue) Flush()

Flush mocks base method.

func (*MockinstanceQueue) Size added in v1.0.1

func (m *MockinstanceQueue) Size() int

Size mocks base method.

type MockinstanceQueueMockRecorder

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

MockinstanceQueueMockRecorder is the mock recorder for MockinstanceQueue.

func (*MockinstanceQueueMockRecorder) Close

Close indicates an expected call of Close.

func (*MockinstanceQueueMockRecorder) Enqueue

func (mr *MockinstanceQueueMockRecorder) Enqueue(buf interface{}) *gomock.Call

Enqueue indicates an expected call of Enqueue.

func (*MockinstanceQueueMockRecorder) Flush added in v1.2.0

Flush indicates an expected call of Flush.

func (*MockinstanceQueueMockRecorder) Size added in v1.0.1

Size indicates an expected call of Size.

type MockinstanceWriter

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

MockinstanceWriter is a mock of instanceWriter interface.

func NewMockinstanceWriter

func NewMockinstanceWriter(ctrl *gomock.Controller) *MockinstanceWriter

NewMockinstanceWriter creates a new mock instance.

func (*MockinstanceWriter) Close

func (m *MockinstanceWriter) Close() error

Close mocks base method.

func (*MockinstanceWriter) EXPECT

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

func (*MockinstanceWriter) Flush

func (m *MockinstanceWriter) Flush() error

Flush mocks base method.

func (*MockinstanceWriter) QueueSize added in v1.0.1

func (m *MockinstanceWriter) QueueSize() int

QueueSize mocks base method.

func (*MockinstanceWriter) Write

func (m *MockinstanceWriter) Write(shard uint32, payload payloadUnion) error

Write mocks base method.

type MockinstanceWriterManager

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

MockinstanceWriterManager is a mock of instanceWriterManager interface.

func NewMockinstanceWriterManager

func NewMockinstanceWriterManager(ctrl *gomock.Controller) *MockinstanceWriterManager

NewMockinstanceWriterManager creates a new mock instance.

func (*MockinstanceWriterManager) AddInstances

func (m *MockinstanceWriterManager) AddInstances(instances []placement.Instance) error

AddInstances mocks base method.

func (*MockinstanceWriterManager) Close

func (m *MockinstanceWriterManager) Close() error

Close mocks base method.

func (*MockinstanceWriterManager) EXPECT

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

func (*MockinstanceWriterManager) Flush

func (m *MockinstanceWriterManager) Flush() error

Flush mocks base method.

func (*MockinstanceWriterManager) RemoveInstances

func (m *MockinstanceWriterManager) RemoveInstances(instances []placement.Instance) error

RemoveInstances mocks base method.

func (*MockinstanceWriterManager) Write

func (m *MockinstanceWriterManager) Write(instance placement.Instance, shardID uint32, payload payloadUnion) error

Write mocks base method.

type MockinstanceWriterManagerMockRecorder

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

MockinstanceWriterManagerMockRecorder is the mock recorder for MockinstanceWriterManager.

func (*MockinstanceWriterManagerMockRecorder) AddInstances

func (mr *MockinstanceWriterManagerMockRecorder) AddInstances(instances interface{}) *gomock.Call

AddInstances indicates an expected call of AddInstances.

func (*MockinstanceWriterManagerMockRecorder) Close

Close indicates an expected call of Close.

func (*MockinstanceWriterManagerMockRecorder) Flush

Flush indicates an expected call of Flush.

func (*MockinstanceWriterManagerMockRecorder) RemoveInstances

func (mr *MockinstanceWriterManagerMockRecorder) RemoveInstances(instances interface{}) *gomock.Call

RemoveInstances indicates an expected call of RemoveInstances.

func (*MockinstanceWriterManagerMockRecorder) Write

func (mr *MockinstanceWriterManagerMockRecorder) Write(instance, shardID, payload interface{}) *gomock.Call

Write indicates an expected call of Write.

type MockinstanceWriterMockRecorder

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

MockinstanceWriterMockRecorder is the mock recorder for MockinstanceWriter.

func (*MockinstanceWriterMockRecorder) Close

Close indicates an expected call of Close.

func (*MockinstanceWriterMockRecorder) Flush

Flush indicates an expected call of Flush.

func (*MockinstanceWriterMockRecorder) QueueSize added in v1.0.1

func (mr *MockinstanceWriterMockRecorder) QueueSize() *gomock.Call

QueueSize indicates an expected call of QueueSize.

func (*MockinstanceWriterMockRecorder) Write

func (mr *MockinstanceWriterMockRecorder) Write(shard, payload interface{}) *gomock.Call

Write indicates an expected call of Write.

type Options

type Options interface {
	// Validate validates the client options.
	Validate() error

	// SetAggregatorClientType sets the client type.
	SetAggregatorClientType(value AggregatorClientType) Options

	// AggregatorClientType returns the client type.
	AggregatorClientType() AggregatorClientType

	// SetM3MsgOptions sets the M3Msg aggregator client options.
	SetM3MsgOptions(value M3MsgOptions) Options

	// M3MsgOptions returns the M3Msg aggregator client options.
	M3MsgOptions() M3MsgOptions

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

	// SetEncoderOptions sets the encoder options.
	SetEncoderOptions(value protobuf.UnaggregatedOptions) Options

	// EncoderOptions returns the encoder options.
	EncoderOptions() protobuf.UnaggregatedOptions

	// SetShardFn sets the sharding function.
	SetShardFn(value sharding.ShardFn) Options

	// ShardFn returns the sharding function.
	ShardFn() sharding.ShardFn

	// SetWatcherOptions sets the placement watcher options.
	SetWatcherOptions(value placement.WatcherOptions) Options

	// WatcherOptions returns the placement watcher options.
	WatcherOptions() placement.WatcherOptions

	// SetShardCutoverWarmupDuration sets the warm up duration for traffic cut over to a shard.
	SetShardCutoverWarmupDuration(value time.Duration) Options

	// ShardCutoverWarmupDuration returns the warm up duration for traffic cut over to a shard.
	ShardCutoverWarmupDuration() time.Duration

	// SetShardCutoffLingerDuration sets the linger duration for traffic cut off from a shard.
	SetShardCutoffLingerDuration(value time.Duration) Options

	// ShardCutoffLingerDuration returns the linger duration for traffic cut off from a shard.
	ShardCutoffLingerDuration() time.Duration

	// SetConnectionOptions sets the connection options.
	SetConnectionOptions(value ConnectionOptions) Options

	// ConnectionOptions returns the connection options.
	ConnectionOptions() ConnectionOptions

	// SetFlushWorkerCount sets the max number of workers used for flushing.
	SetFlushWorkerCount(value int) Options

	// FlushWorkerCount returns the max number of workers used for flushing.
	FlushWorkerCount() int

	// SetForceFlushEvery sets the duration between forced flushes.
	SetForceFlushEvery(value time.Duration) Options

	// ForceFlushEvery returns the duration, if any, between forced flushes.
	ForceFlushEvery() time.Duration

	// SetMaxTimerBatchSize sets the maximum timer batch size.
	SetMaxTimerBatchSize(value int) Options

	// MaxTimerBatchSize returns the maximum timer batch size.
	MaxTimerBatchSize() int

	// SetInstanceQueueSize sets the instance queue size.
	SetInstanceQueueSize(value int) Options

	// InstanceQueueSize returns the instance queue size.
	InstanceQueueSize() int

	// SetQueueDropType sets the strategy for which metrics should metrics should be dropped when
	// the queue is full.
	SetQueueDropType(value DropType) Options

	// QueueDropType returns sets the strategy for which metrics should metrics should be dropped
	// when the queue is full.
	QueueDropType() DropType

	// SetMaxBatchSize sets the buffer limit that triggers a write of queued buffers.
	SetMaxBatchSize(value int) Options

	// MaxBatchSize returns the maximum buffer size that triggers a queue drain.
	MaxBatchSize() int

	// SetRWOptions sets RW options.
	SetRWOptions(value xio.Options) Options

	// RWOptions returns the RW options.
	RWOptions() xio.Options
}

Options provide a set of client options.

func NewOptions

func NewOptions() Options

NewOptions creates a new set of client options.

type TCPClient added in v1.0.1

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

TCPClient sends metrics to M3 Aggregator via over custom TCP protocol.

func NewTCPClient added in v1.0.1

func NewTCPClient(opts Options) (*TCPClient, error)

NewTCPClient returns new Protobuf over TCP M3 Aggregator client.

func (*TCPClient) ActivePlacement added in v1.0.1

func (c *TCPClient) ActivePlacement() (placement.Placement, int, error)

ActivePlacement returns a copy of the currently active placement and its version.

func (*TCPClient) ActivePlacementVersion added in v1.0.1

func (c *TCPClient) ActivePlacementVersion() (int, error)

ActivePlacementVersion returns a copy of the currently active placement version. It is a far less expensive call than ActivePlacement, as it does not clone the placement.

func (*TCPClient) Close added in v1.0.1

func (c *TCPClient) Close() error

Close closes the client.

func (*TCPClient) Flush added in v1.0.1

func (c *TCPClient) Flush() error

Flush flushes any remaining data buffered by the client.

func (*TCPClient) Init added in v1.0.1

func (c *TCPClient) Init() error

Init initializes TCPClient.

func (*TCPClient) WriteForwarded added in v1.0.1

func (c *TCPClient) WriteForwarded(
	metric aggregated.ForwardedMetric,
	metadata metadata.ForwardMetadata,
) error

WriteForwarded writes forwarded metrics.

func (*TCPClient) WritePassthrough added in v1.0.1

func (c *TCPClient) WritePassthrough(
	metric aggregated.Metric,
	storagePolicy policy.StoragePolicy,
) error

WritePassthrough writes passthrough metrics.

func (*TCPClient) WriteTimed added in v1.0.1

func (c *TCPClient) WriteTimed(
	metric aggregated.Metric,
	metadata metadata.TimedMetadata,
) error

WriteTimed writes timed metrics.

func (*TCPClient) WriteTimedWithStagedMetadatas added in v1.0.1

func (c *TCPClient) WriteTimedWithStagedMetadatas(
	metric aggregated.Metric,
	metadatas metadata.StagedMetadatas,
) error

WriteTimedWithStagedMetadatas writes timed metrics with staged metadatas.

func (*TCPClient) WriteUntimedBatchTimer added in v1.0.1

func (c *TCPClient) WriteUntimedBatchTimer(
	batchTimer unaggregated.BatchTimer,
	metadatas metadata.StagedMetadatas,
) error

WriteUntimedBatchTimer writes untimed batch timer metrics.

func (*TCPClient) WriteUntimedCounter added in v1.0.1

func (c *TCPClient) WriteUntimedCounter(
	counter unaggregated.Counter,
	metadatas metadata.StagedMetadatas,
) error

WriteUntimedCounter writes untimed counter metrics.

func (*TCPClient) WriteUntimedGauge added in v1.0.1

func (c *TCPClient) WriteUntimedGauge(
	gauge unaggregated.Gauge,
	metadatas metadata.StagedMetadatas,
) error

WriteUntimedGauge writes untimed gauge metrics.

Jump to

Keyboard shortcuts

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