Documentation ¶
Index ¶
- func DecIntBy(d Datum, v int64, ts time.Time)
- func GetFloat(d Datum) float64
- func GetInt(d Datum) int64
- func GetString(d Datum) string
- func IncIntBy(d Datum, v int64, ts time.Time)
- func SetFloat(d Datum, v float64, ts time.Time)
- func SetInt(d Datum, v int64, ts time.Time)
- func SetString(d Datum, v string, ts time.Time)
- type BaseDatum
- type Datum
- type FloatDatum
- type IntDatum
- func (d *IntDatum) DecBy(delta int64, timestamp time.Time)
- func (d *IntDatum) Get() int64
- func (d *IntDatum) IncBy(delta int64, timestamp time.Time)
- func (d *IntDatum) MarshalJSON() ([]byte, error)
- func (d *IntDatum) Set(value int64, timestamp time.Time)
- func (d *IntDatum) String() string
- func (*IntDatum) Type() Type
- func (d *IntDatum) ValueString() string
- type StringDatum
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecIntBy ¶
DecIntBy increments an integer Datum by the provided value, at time ts, or panics if the Datum is not an IntDatum.
func IncIntBy ¶
IncIntBy increments an integer Datum by the provided value, at time ts, or panics if the Datum is not an IntDatum.
func SetFloat ¶
SetFloat sets a floating-point Datum to the provided value and timestamp, or panics if the Datum is not a FloatDatum.
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 // Time returns the timestamp of the Datum as time.Time in UTC TimeUTC() time.Time }
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.
func MakeString ¶
MakeString creates a new string 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.
type StringDatum ¶
StringDatum describes a string value at a given timestamp.
func (*StringDatum) Get ¶
func (d *StringDatum) Get() string
Get returns the value of the StringDatum
func (*StringDatum) MarshalJSON ¶
func (d *StringDatum) MarshalJSON() ([]byte, error)
MarshalJSON returns a JSON encoding of the StringDatum.
func (*StringDatum) Set ¶
func (d *StringDatum) Set(value string, timestamp time.Time)
Set sets the value of the StringDatum to the value at timestamp.
func (*StringDatum) String ¶
func (d *StringDatum) String() string
String returns a string representation of the StringDatum.
func (*StringDatum) Type ¶
func (*StringDatum) Type() Type
Type returns the Type of an StringDatum, String.
func (*StringDatum) ValueString ¶
func (d *StringDatum) ValueString() string
ValueString returns the value of the StringDatum as a string.