Documentation ¶
Overview ¶
A collection of measurements.
Index ¶
- type Bucket
- func (b *Bucket) Append(val float64)
- func (b *Bucket) ComplexMetric() *LibratoMetric
- func (b *Bucket) Count() int
- func (b *Bucket) EmitCounters() []*LibratoMetric
- func (b *Bucket) EmitMeasurements() []*LibratoMetric
- func (b *Bucket) EmitSamples() []*LibratoMetric
- func (b *Bucket) Incr(val float64)
- func (b *Bucket) Last() float64
- func (b *Bucket) Max() float64
- func (b *Bucket) Mean() float64
- func (b *Bucket) Median() float64
- func (b *Bucket) Merge(other *Bucket)
- func (b *Bucket) Metric(suffix string, val float64) *LibratoMetric
- func (b *Bucket) Metrics() []*LibratoMetric
- func (b *Bucket) Min() float64
- func (b *Bucket) Perc95() float64
- func (b *Bucket) Perc99() float64
- func (b *Bucket) Reset()
- func (b *Bucket) Sort()
- func (b *Bucket) String() string
- type Id
- type LibratoMetric
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
func (*Bucket) ComplexMetric ¶
func (b *Bucket) ComplexMetric() *LibratoMetric
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) 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.
type Id ¶
type Id struct { Time time.Time Resolution time.Duration Auth string ReadyAt time.Time Name string Units string Source string Type string }
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).