client

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2019 License: Apache-2.0 Imports: 30 Imported by: 0

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

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

NewClient creates a new client.

type Configuration

type Configuration struct {
	PlacementKV                kv.OverrideConfiguration       `yaml:"placementKV" validate:"nonzero"`
	PlacementWatcher           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"`
	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,
) (AdminClient, error)

NewAdminClient creates a new admin client.

func (*Configuration) NewClient

func (c *Configuration) NewClient(
	kvClient m3clusterclient.Client,
	clockOpts clock.Options,
	instrumentOpts instrument.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
}

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

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

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

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

WriteTimed indicates an expected call of WriteTimed

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

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

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

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

WriteTimed indicates an expected call of WriteTimed

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

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

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

func (mr *MockinstanceWriterMockRecorder) Write(shard, payload 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

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

	// SetStagedPlacementWatcherOptions sets the staged placement watcher options.
	SetStagedPlacementWatcherOptions(value placement.StagedPlacementWatcherOptions) Options

	// StagedPlacementWatcherOptions returns the staged placement watcher options.
	StagedPlacementWatcherOptions() placement.StagedPlacementWatcherOptions

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

	// SetFlushSize sets the buffer size to trigger a flush.
	SetFlushSize(value int) Options

	// FlushSize returns the buffer size to trigger a flush.
	FlushSize() int

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

Options provide a set of client options.

func NewOptions

func NewOptions() Options

NewOptions creates a new set of client options.

Jump to

Keyboard shortcuts

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