bucket

package
v0.0.0-...-de99981 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2014 License: GPL-3.0 Imports: 8 Imported by: 5

Documentation

Overview

A collection of measurements.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	sync.Mutex
	Id   *Id
	Vals []float64
	Sum  float64
}

func (*Bucket) Append

func (b *Bucket) Append(val float64)

func (*Bucket) ComplexMetric

func (b *Bucket) ComplexMetric() *LibratoMetric

func (*Bucket) Count

func (b *Bucket) Count() int

func (*Bucket) EmitCounters

func (b *Bucket) EmitCounters() []*LibratoMetric

func (*Bucket) EmitMeasurements

func (b *Bucket) EmitMeasurements() []*LibratoMetric

The standard emitter. All log data with `measure.foo` will be mapped to the MeasureEmitter.

func (*Bucket) EmitSamples

func (b *Bucket) EmitSamples() []*LibratoMetric

func (*Bucket) Incr

func (b *Bucket) Incr(val float64)

func (*Bucket) Last

func (b *Bucket) Last() float64

func (*Bucket) Max

func (b *Bucket) Max() float64

func (*Bucket) Mean

func (b *Bucket) Mean() float64

func (*Bucket) Median

func (b *Bucket) Median() float64

func (*Bucket) Merge

func (b *Bucket) Merge(other *Bucket)

func (*Bucket) Metric

func (b *Bucket) Metric(suffix string, val float64) *LibratoMetric

If an non-empty suffix is given, the name of the resulting LibratoMetric will contain the suffix.

func (*Bucket) Metrics

func (b *Bucket) Metrics() []*LibratoMetric

Relies on the Emitter to determine which type of metrics should be returned.

func (*Bucket) Min

func (b *Bucket) Min() float64

func (*Bucket) Perc95

func (b *Bucket) Perc95() float64

func (*Bucket) Perc99

func (b *Bucket) Perc99() float64

func (*Bucket) Reset

func (b *Bucket) Reset()

func (*Bucket) Sort

func (b *Bucket) Sort()

func (*Bucket) String

func (b *Bucket) String() string

type Id

type Id struct {
	Time       time.Time
	Resolution time.Duration
	Auth       string
	ReadyAt    time.Time
	Name       string
	Units      string
	Source     string
	Type       string
}

func (*Id) Decode

func (id *Id) Decode(b *bytes.Buffer) error

func (*Id) Delay

func (id *Id) Delay(t time.Time) int64

The number of time units returned represents the processing time accumulated within l2met. E.g. If the resolution of the bucket/id is 60s and the delay is 2, then it took 120s for l2met to process the bucket.

func (*Id) Encode

func (id *Id) Encode() ([]byte, error)

func (*Id) Partition

func (id *Id) Partition(max uint64) uint64

type LibratoMetric

type LibratoMetric struct {
	Name   string        `json:"name"`
	Time   int64         `json:"measure_time"`
	Val    *float64      `json:"value,omitempty"`
	Count  *int          `json:"count,omitempty"`
	Sum    *float64      `json:"sum,omitempty"`
	Max    *float64      `json:"max,omitempty"`
	Min    *float64      `json:"min,omitempty"`
	Source string        `json:"source,omitempty"`
	Auth   string        `json:"-"`
	Attr   *libratoAttrs `json:"attributes,omitempty"`
}

When submitting data to Librato, we need to coerce our bucket representation into something their API can handle. Because there is not a 1-1 parity with the statistical functions that a bucket offers and the types of data the Librato API accepts (e.g. Librato does- not have support for perc50, perc95, perc99) we need to expand our bucket into a set of LibratoMetric(s).

Jump to

Keyboard shortcuts

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