config

package
v0.0.0-...-ed22221 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Perc50  = float64(0.50)
	Perc75  = float64(0.75)
	Perc95  = float64(0.95)
	Perc99  = float64(0.99)
	Perc999 = float64(0.999)
	Perc100 = float64(1)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AllFilter

type AllFilter struct{}

func (*AllFilter) Percentiles

func (n *AllFilter) Percentiles(metric string) []float64

func (*AllFilter) ShouldReport

func (n *AllFilter) ShouldReport(metric string, value float64) bool

type Config

type Config struct {
	Filter            Filter
	Client            PutMetricsClient
	ReportingInterval time.Duration
	Registry          metrics.Registry
	Namespace         string
	StaticDimensions  map[string]string
	DurationUnit      time.Duration

	PreviousCounterValues map[string]int64 // when provided, we store previous counters here and use them to compute diffs instead of clearing counters
}

type Filter

type Filter interface {
	ShouldReport(metric string, value float64) bool
	Percentiles(metric string) []float64
}

type NoFilter

type NoFilter struct{}

func (*NoFilter) Percentiles

func (n *NoFilter) Percentiles(metric string) []float64

func (*NoFilter) ShouldReport

func (n *NoFilter) ShouldReport(metric string, value float64) bool

type PutMetricsClient

type PutMetricsClient interface {
	PutMetricData(*cloudwatch.PutMetricDataInput) (*cloudwatch.PutMetricDataOutput, error)
}

Jump to

Keyboard shortcuts

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