dpfilters

package
v4.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package dpfilters has logic describing the filtering of unwanted metrics. Filters are configured from the agent configuration file and is intended to be passed into each monitor for use if it sends datapoints on its own.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatapointFilter

type DatapointFilter interface {
	// Matches takes a datapoint and returns whether it is matched by the
	// filter
	Matches(*datapoint.Datapoint) bool
}

DatapointFilter can be used to filter out datapoints

func New

func New(monitorType string, metricNames []string, dimensions map[string]string, negated bool) (DatapointFilter, error)

New returns a new filter with the given configuration

type FilterSet

type FilterSet struct {
	ExcludeFilters []DatapointFilter
	IncludeFilters []DatapointFilter
}

FilterSet is a collection of datapont filters, any one of which must match for a datapoint to be matched.

func (*FilterSet) Matches

func (fs *FilterSet) Matches(dp *datapoint.Datapoint) bool

Matches sends a datapoint through each of the filters in the set and returns true if at least one of them matches the datapoint.

Jump to

Keyboard shortcuts

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