Documentation ¶
Index ¶
- Constants
- Variables
- type AggregatorConfig
- type Filter
- type InputConfig
- type OutputConfig
- type ProcessorConfig
- type RunningAggregator
- func (r *RunningAggregator) Add(in tinymonitor.Metric) bool
- func (r *RunningAggregator) MakeMetric(measurement string, fields map[string]interface{}, tags map[string]string, ...) tinymonitor.Metric
- func (r *RunningAggregator) Name() string
- func (r *RunningAggregator) Run(acc tinymonitor.Accumulator, shutdown chan struct{})
- type RunningInput
- func (r *RunningInput) MakeMetric(measurement string, fields map[string]interface{}, tags map[string]string, ...) tinymonitor.Metric
- func (r *RunningInput) Name() string
- func (r *RunningInput) SetDefaultTags(tags map[string]string)
- func (r *RunningInput) SetTrace(trace bool)
- func (r *RunningInput) Trace() bool
- type RunningOutput
- type RunningProcessor
- type RunningProcessors
- type TagFilter
Constants ¶
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 ¶
var GlobalMetricsGathered = selfstat.Register("agent", "metrics_gathered", map[string]string{})
Functions ¶
This section is empty.
Types ¶
type AggregatorConfig ¶
type AggregatorConfig struct { Name string DropOriginal bool NameOverride string MeasurementPrefix string MeasurementSuffix string Tags map[string]string Filter Filter Period time.Duration Delay time.Duration }
AggregatorConfig containing configuration parameters for the running aggregator plugin.
type Filter ¶
type Filter struct { NameDrop []string NamePass []string FieldDrop []string FieldPass []string TagDrop []TagFilter TagPass []TagFilter TagExclude []string TagInclude []string // contains filtered or unexported fields }
Filter containing drop/pass and tagdrop/tagpass rules
func (*Filter) Apply ¶
func (f *Filter) Apply( measurement string, fields map[string]interface{}, tags map[string]string, ) bool
Apply applies the filter to the given measurement name, fields map, and tags map. It will return false if the metric should be "filtered out", and true if the metric should "pass". It will modify tags & fields in-place if they need to be deleted.
type InputConfig ¶
type InputConfig struct { Name string NameOverride string MeasurementPrefix string MeasurementSuffix string Tags map[string]string Filter Filter Interval time.Duration }
InputConfig containing a name, interval, and filter
type OutputConfig ¶
OutputConfig containing name and filter
type ProcessorConfig ¶
FilterConfig containing a name and filter
type RunningAggregator ¶
type RunningAggregator struct { Config *AggregatorConfig // contains filtered or unexported fields }
func NewRunningAggregator ¶
func NewRunningAggregator( a tinymonitor.Aggregator, conf *AggregatorConfig, ) *RunningAggregator
func (*RunningAggregator) Add ¶
func (r *RunningAggregator) Add(in tinymonitor.Metric) bool
Add applies the given metric to the aggregator. Before applying to the plugin, it will run any defined filters on the metric. Apply returns true if the original metric should be dropped.
func (*RunningAggregator) MakeMetric ¶
func (r *RunningAggregator) MakeMetric( measurement string, fields map[string]interface{}, tags map[string]string, mType tinymonitor.ValueType, t time.Time, ) tinymonitor.Metric
func (*RunningAggregator) Name ¶
func (r *RunningAggregator) Name() string
func (*RunningAggregator) Run ¶
func (r *RunningAggregator) Run( acc tinymonitor.Accumulator, shutdown chan struct{}, )
Run runs the running aggregator, listens for incoming metrics, and waits for period ticks to tell it when to push and reset the aggregator.
type RunningInput ¶
type RunningInput struct { Input tinymonitor.Input Config *InputConfig MetricsGathered selfstat.Stat // contains filtered or unexported fields }
func NewRunningInput ¶
func NewRunningInput( input tinymonitor.Input, config *InputConfig, ) *RunningInput
func (*RunningInput) MakeMetric ¶
func (r *RunningInput) MakeMetric( measurement string, fields map[string]interface{}, tags map[string]string, mType tinymonitor.ValueType, t time.Time, ) tinymonitor.Metric
MakeMetric either returns a metric, or returns nil if the metric doesn't need to be created (because of filtering, an error, etc.)
func (*RunningInput) Name ¶
func (r *RunningInput) Name() string
func (*RunningInput) SetDefaultTags ¶
func (r *RunningInput) SetDefaultTags(tags map[string]string)
func (*RunningInput) SetTrace ¶
func (r *RunningInput) SetTrace(trace bool)
func (*RunningInput) Trace ¶
func (r *RunningInput) Trace() bool
type RunningOutput ¶
type RunningOutput struct { Name string Output tinymonitor.Output Config *OutputConfig MetricBufferLimit int MetricBatchSize int MetricsFiltered selfstat.Stat MetricsWritten selfstat.Stat BufferSize selfstat.Stat BufferLimit selfstat.Stat WriteTime selfstat.Stat // Guards against concurrent calls to the Output as described in #3009 sync.Mutex // contains filtered or unexported fields }
RunningOutput contains the output configuration
func NewRunningOutput ¶
func NewRunningOutput( name string, output tinymonitor.Output, conf *OutputConfig, batchSize int, bufferLimit int, ) *RunningOutput
func (*RunningOutput) AddMetric ¶
func (ro *RunningOutput) AddMetric(m tinymonitor.Metric)
AddMetric adds a metric to the output. This function can also write cached points if FlushBufferWhenFull is true.
func (*RunningOutput) Write ¶
func (ro *RunningOutput) Write() error
Write writes all cached points to this output.
type RunningProcessor ¶
type RunningProcessor struct { Name string sync.Mutex Processor tinymonitor.Processor Config *ProcessorConfig }
func (*RunningProcessor) Apply ¶
func (rp *RunningProcessor) Apply(in ...tinymonitor.Metric) []tinymonitor.Metric
type RunningProcessors ¶
type RunningProcessors []*RunningProcessor
func (RunningProcessors) Len ¶
func (rp RunningProcessors) Len() int
func (RunningProcessors) Less ¶
func (rp RunningProcessors) Less(i, j int) bool
func (RunningProcessors) Swap ¶
func (rp RunningProcessors) Swap(i, j int)