out

package
v0.0.0-...-6c4e3c2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2019 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteFloat64

func WriteFloat64(buf []byte, key []byte, val float64, now int64) []byte

func WriteInt64

func WriteInt64(buf []byte, key []byte, val, now int64) []byte

Types

type Counters

type Counters struct {
	Values map[string]float64
	// contains filtered or unexported fields
}

func NewCounters

func NewCounters(flushRates, flushCounts bool) *Counters

func (*Counters) Add

func (c *Counters) Add(metric *common.Metric)

Add updates the counters map, adding the metric key if needed

func (*Counters) Process

func (c *Counters) Process(buf []byte, now int64, interval int, f Formatter) ([]byte, int64)

processCounters computes the outbound metrics for counters and puts them in the buffer

type Data

type Data struct {
	Points           Float64Slice
	Amount_submitted int64
}

type Float64Slice

type Float64Slice []float64

func (Float64Slice) Len

func (s Float64Slice) Len() int

func (Float64Slice) Less

func (s Float64Slice) Less(i, j int) bool

func (Float64Slice) Swap

func (s Float64Slice) Swap(i, j int)

type Formatter

type Formatter struct {
	// prefix of statsdaemon's own metrics2.0 stats
	PrefixInternal string

	// formatting of old style metrics
	Legacy_namespace bool
	Prefix_counters  string
	Prefix_gauges    string
	Prefix_rates     string
	Prefix_timers    string

	// formatting of metrics2.0
	Prefix_m20_counters string
	Prefix_m20_gauges   string
	Prefix_m20_rates    string
	Prefix_m20_timers   string

	// metrics2.0 using _is_ convention instead of =
	Prefix_m20ne_counters string
	Prefix_m20ne_gauges   string
	Prefix_m20ne_rates    string
	Prefix_m20ne_timers   string
}

type Gauges

type Gauges struct {
	Values map[string]float64
}

func NewGauges

func NewGauges() *Gauges

func (*Gauges) Add

func (g *Gauges) Add(metric *common.Metric)

Add updates the gauges with the latest value for given key

func (*Gauges) Process

func (g *Gauges) Process(buf []byte, now int64, interval int, f Formatter) ([]byte, int64)

Process puts gauges in the outbound buffer

type Output

type Output struct {
	Metrics       chan []*common.Metric
	MetricAmounts chan []*common.Metric
	Valid_lines   *topic.Topic
	Invalid_lines *topic.Topic
}

func NullOutput

func NullOutput() *Output

type Percentile

type Percentile struct {
	// contains filtered or unexported fields
}

func NewPercentile

func NewPercentile(pctl string) (*Percentile, error)

func (*Percentile) String

func (p *Percentile) String() string

type Percentiles

type Percentiles []*Percentile

func NewPercentiles

func NewPercentiles(pctls string) (*Percentiles, error)

func (*Percentiles) Set

func (a *Percentiles) Set(s string) error

func (*Percentiles) String

func (a *Percentiles) String() string

type Timers

type Timers struct {
	Values map[string]Data
	// contains filtered or unexported fields
}

func NewTimers

func NewTimers(pctls Percentiles) *Timers

func (*Timers) Add

func (timers *Timers) Add(metric *common.Metric)

Add updates the timers map, adding the metric key if needed

func (*Timers) Process

func (timers *Timers) Process(buf []byte, now int64, interval int, f Formatter) ([]byte, int64)

Process computes the outbound metrics for timers and puts them in the buffer

func (*Timers) String

func (t *Timers) String() string

type Type

type Type interface {
	Add(metric *common.Metric)
	Process(buf []byte, now int64, interval int, f Formatter) ([]byte, int64)
}

Jump to

Keyboard shortcuts

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