models

package
Version: v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2016 License: MIT Imports: 6 Imported by: 0

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 Filter

type Filter struct {
	NameDrop []string

	NamePass []string

	FieldDrop []string

	FieldPass []string

	TagDrop []TagFilter
	TagPass []TagFilter

	TagExclude []string

	TagInclude []string

	IsActive bool
	// contains filtered or unexported fields
}

Filter containing drop/pass and tagdrop/tagpass rules

func (*Filter) CompileFilter

func (f *Filter) CompileFilter() error

Compile all Filter lists into filter.Filter objects.

func (*Filter) FilterTags added in v0.7.0

func (f *Filter) FilterTags(tags map[string]string)

Apply TagInclude and TagExclude filters. modifies the tags map in-place.

func (*Filter) ShouldFieldsPass added in v0.7.0

func (f *Filter) ShouldFieldsPass(key string) bool

ShouldFieldsPass returns true if the metric should pass, false if should drop based on the drop/pass filter parameters

func (*Filter) ShouldMetricPass

func (f *Filter) ShouldMetricPass(metric telegraf.Metric) bool

func (*Filter) ShouldNamePass

func (f *Filter) ShouldNamePass(key string) bool

ShouldFieldsPass returns true if the metric should pass, false if should drop based on the drop/pass filter parameters

func (*Filter) ShouldTagsPass added in v0.7.0

func (f *Filter) ShouldTagsPass(tags map[string]string) bool

ShouldTagsPass returns true if the metric should pass, false if should drop based on the tagdrop/tagpass filter parameters

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

type OutputConfig struct {
	Name   string
	Filter Filter
}

OutputConfig containing name and filter

type RunningInput

type RunningInput struct {
	Name   string
	Input  telegraf.Input
	Config *InputConfig
}

type RunningOutput

type RunningOutput struct {
	Name              string
	Output            telegraf.Output
	Config            *OutputConfig
	Quiet             bool
	MetricBufferLimit int
	MetricBatchSize   int
	// contains filtered or unexported fields
}

RunningOutput contains the output configuration

func NewRunningOutput

func NewRunningOutput(
	name string,
	output telegraf.Output,
	conf *OutputConfig,
	batchSize int,
	bufferLimit int,
) *RunningOutput

func (*RunningOutput) AddMetric

func (ro *RunningOutput) AddMetric(metric telegraf.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 TagFilter added in v0.7.0

type TagFilter struct {
	Name   string
	Filter []string
	// contains filtered or unexported fields
}

TagFilter is the name of a tag, and the values on which to filter

Jump to

Keyboard shortcuts

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