Documentation
¶
Overview ¶
A collection of measurements.
Index ¶
- type Bucket
- func (b *Bucket) Add(otherM *Bucket)
- func (b *Bucket) ComplexMetric() *LibratoMetric
- func (b *Bucket) Count() int
- func (b *Bucket) EmitCounters() []*LibratoMetric
- func (b *Bucket) EmitMeasurements() []*LibratoMetric
- func (b *Bucket) EmiteSamples() []*LibratoMetric
- func (b *Bucket) Last() float64
- func (b *Bucket) Max() float64
- func (b *Bucket) Mean() float64
- func (b *Bucket) Median() float64
- func (b *Bucket) Metric(name string, val float64) *LibratoMetric
- func (b *Bucket) Metrics() []*LibratoMetric
- func (b *Bucket) Min() float64
- func (b *Bucket) P95() float64
- func (b *Bucket) P99() float64
- func (b *Bucket) Sort()
- func (b *Bucket) String() string
- func (b *Bucket) Sum() float64
- type Id
- type LibratoMetric
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
func (*Bucket) Add ¶
Adding bucket a to bucket b copies the vals of bucket b and appends them to the vals of bucket a. Nothing is done with the Ids of the buckets. You should ensure that buckets have the same Id.
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) EmiteSamples ¶
func (b *Bucket) EmiteSamples() []*LibratoMetric
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 p50, p95, p99) we need to expand our bucket into a set of LibratoMetric(s).