mapper

package
v0.0.0-...-a0f4a55 Latest Latest
Warning

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

Go to latest
Published: May 27, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionType

type ActionType string
const (
	ActionTypeMap     ActionType = "map"
	ActionTypeDrop    ActionType = "drop"
	ActionTypeDefault ActionType = ""
)

func (*ActionType) UnmarshalYAML

func (t *ActionType) UnmarshalYAML(unmarshal func(interface{}) error) error

type MatchType

type MatchType string
const (
	MatchTypeGlob    MatchType = "glob"
	MatchTypeRegex   MatchType = "regex"
	MatchTypeDefault MatchType = ""
)

func (*MatchType) UnmarshalYAML

func (t *MatchType) UnmarshalYAML(unmarshal func(interface{}) error) error

type MetricMapper

type MetricMapper struct {
	Defaults mapperConfigDefaults `yaml:"defaults"`
	Mappings []MetricMapping      `yaml:"mappings"`
	FSM      *fsm.FSM

	MappingsCount prometheus.Gauge
	// contains filtered or unexported fields
}

func (*MetricMapper) GetMapping

func (m *MetricMapper) GetMapping(statsdMetric string, statsdMetricType MetricType) (*MetricMapping, prometheus.Labels, bool)

func (*MetricMapper) InitCache

func (m *MetricMapper) InitCache(cacheSize int)

func (*MetricMapper) InitFromFile

func (m *MetricMapper) InitFromFile(fileName string, cacheSize int) error

func (*MetricMapper) InitFromYAMLString

func (m *MetricMapper) InitFromYAMLString(fileContents string, cacheSize int) error

type MetricMapperCache

type MetricMapperCache interface {
	Get(metricString string) (*MetricMapperCacheResult, bool)
	AddMatch(metricString string, mapping *MetricMapping, labels prometheus.Labels)
	AddMiss(metricString string)
}

type MetricMapperCacheResult

type MetricMapperCacheResult struct {
	Mapping *MetricMapping
	Matched bool
	Labels  prometheus.Labels
}

type MetricMapperLRUCache

type MetricMapperLRUCache struct {
	MetricMapperCache
	// contains filtered or unexported fields
}

func NewMetricMapperCache

func NewMetricMapperCache(size int) (*MetricMapperLRUCache, error)

func (*MetricMapperLRUCache) AddMatch

func (m *MetricMapperLRUCache) AddMatch(metricString string, mapping *MetricMapping, labels prometheus.Labels)

func (*MetricMapperLRUCache) AddMiss

func (m *MetricMapperLRUCache) AddMiss(metricString string)

func (*MetricMapperLRUCache) Get

func (m *MetricMapperLRUCache) Get(metricString string) (*MetricMapperCacheResult, bool)

type MetricMapperNoopCache

type MetricMapperNoopCache struct {
	MetricMapperCache
}

func NewMetricMapperNoopCache

func NewMetricMapperNoopCache() *MetricMapperNoopCache

func (*MetricMapperNoopCache) AddMatch

func (m *MetricMapperNoopCache) AddMatch(metricString string, mapping *MetricMapping, labels prometheus.Labels)

func (*MetricMapperNoopCache) AddMiss

func (m *MetricMapperNoopCache) AddMiss(metricString string)

func (*MetricMapperNoopCache) Get

func (m *MetricMapperNoopCache) Get(metricString string) (*MetricMapperCacheResult, bool)

type MetricMapping

type MetricMapping struct {
	Match string `yaml:"match"`
	Name  string `yaml:"name"`

	Labels prometheus.Labels `yaml:"labels"`

	TimerType       TimerType         `yaml:"timer_type"`
	Buckets         []float64         `yaml:"buckets"`
	Quantiles       []metricObjective `yaml:"quantiles"`
	MatchType       MatchType         `yaml:"match_type"`
	HelpText        string            `yaml:"help"`
	Action          ActionType        `yaml:"action"`
	MatchMetricType MetricType        `yaml:"match_metric_type"`
	Ttl             time.Duration     `yaml:"ttl"`
	// contains filtered or unexported fields
}

type MetricType

type MetricType string
const (
	MetricTypeCounter MetricType = "counter"
	MetricTypeGauge   MetricType = "gauge"
	MetricTypeTimer   MetricType = "timer"
)

func (*MetricType) UnmarshalYAML

func (m *MetricType) UnmarshalYAML(unmarshal func(interface{}) error) error

type TimerType

type TimerType string
const (
	TimerTypeHistogram TimerType = "histogram"
	TimerTypeSummary   TimerType = "summary"
	TimerTypeDefault   TimerType = ""
)

func (*TimerType) UnmarshalYAML

func (t *TimerType) UnmarshalYAML(unmarshal func(interface{}) error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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