Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IncIntBy ¶
IncIntBy increments an integer Datum by the provided value, at time ts, or panics if the Datum is not an IntDatum.
Types ¶
type BaseDatum ¶
type BaseDatum struct {
Time int64 // nanoseconds since unix epoch
}
BaseDatum is a struct used to record timestamps across all Datum implementations.
func (*BaseDatum) TimeString ¶
TimeString returns the timestamp of this Datum as a string.
type Datum ¶
type Datum interface { // Type returns the Datum type. Type() Type // ValueString returns the value of a Datum as a string. ValueString() string // TimeString returns the timestamp of a Datum as a string. TimeString() string }
Datum is an interface for metric datums, with a type, value and timestamp to be exported.
func MakeFloat ¶
MakeFloat creates a new floating-point datum with the provided value and timestamp.
type FloatDatum ¶
FloatDatum describes a floating point value at a given timestamp.
func (*FloatDatum) MarshalJSON ¶
func (d *FloatDatum) MarshalJSON() ([]byte, error)
MarshalJSON returns a JSON encoding of the FloatDatum.
func (*FloatDatum) Set ¶
func (d *FloatDatum) Set(v float64, ts time.Time)
Set sets value of the FloatDatum at the timestamp ts.
func (*FloatDatum) String ¶
func (d *FloatDatum) String() string
String returns a string representation of the FloatDatum.
func (*FloatDatum) ValueString ¶
func (d *FloatDatum) ValueString() string
ValueString returns the value of the FloatDatum as a string.
type IntDatum ¶
IntDatum describes an integer value at a given timestamp.
func (*IntDatum) MarshalJSON ¶
MarshalJSON returns a JSON encoding of the IntDatum.
func (*IntDatum) ValueString ¶
ValueString returns the value of the IntDatum as a string.