Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Default size of metrics batch size. DEFAULT_METRIC_BATCH_SIZE = 1000 // Default number of metrics kept. It should be a multiple of batch size. DEFAULT_METRIC_BUFFER_LIMIT = 10000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
Buffer stores metrics in a circular buffer.
func (*Buffer) Batch ¶
Batch returns a slice containing up to batchSize of the most recently added metrics. Metrics are ordered from newest to oldest in the batch. The batch must not be modified by the client.
type InputConfig ¶
type InputConfig struct { Name string Alias string Interval time.Duration NameOverride string MeasurementPrefix string MeasurementSuffix string Tags map[string]string }
InputConfig is the common config for all inputs.
type OutputConfig ¶
type OutputConfig struct { Name string Alias string FlushInterval time.Duration FlushJitter *time.Duration MetricBufferLimit int MetricBatchSize int }
OutputConfig containing name
type RunningInput ¶
type RunningInput struct { Input plugins.Input Config *InputConfig // contains filtered or unexported fields }
func NewRunningInput ¶
func NewRunningInput(input plugins.Input, config *InputConfig) *RunningInput
func (*RunningInput) Gather ¶
func (r *RunningInput) Gather(acc plugins.Accumulator) error
func (*RunningInput) Init ¶
func (r *RunningInput) Init() error
func (*RunningInput) LogName ¶
func (r *RunningInput) LogName() string
func (*RunningInput) MakeMetric ¶
func (r *RunningInput) MakeMetric(metric internal.Metric) internal.Metric
func (*RunningInput) SetDefaultTags ¶
func (r *RunningInput) SetDefaultTags(tags map[string]string)
type RunningOutput ¶
type RunningOutput struct { Output plugins.Output Config *OutputConfig MetricBufferLimit int MetricBatchSize int BatchReady chan time.Time // contains filtered or unexported fields }
RunningOutput contains the output configuration
func NewRunningOutput ¶
func NewRunningOutput( name string, output plugins.Output, config *OutputConfig, batchSize int, bufferLimit int, ) *RunningOutput
func (*RunningOutput) AddMetric ¶
func (r *RunningOutput) AddMetric(metric internal.Metric)
AddMetric adds a metric to the output.
func (*RunningOutput) Close ¶
func (r *RunningOutput) Close()
func (*RunningOutput) Init ¶
func (r *RunningOutput) Init() error
func (*RunningOutput) LogBufferStatus ¶
func (r *RunningOutput) LogBufferStatus()
func (*RunningOutput) LogName ¶
func (r *RunningOutput) LogName() string
func (*RunningOutput) Write ¶
func (r *RunningOutput) Write() error
Write writes all metrics to the output, stopping when all have been sent on or error.
func (*RunningOutput) WriteBatch ¶
func (r *RunningOutput) WriteBatch() error
WriteBatch writes a single batch of metrics to the output.
Click to show internal directories.
Click to hide internal directories.