Documentation ¶
Index ¶
- type CustomPoint
- func (p *CustomPoint) GetCount() int64
- func (p *CustomPoint) GetTimestamp() int64
- func (p *CustomPoint) GetValue() float64
- func (p *CustomPoint) IsValueNull() bool
- func (p *CustomPoint) Run()
- func (p *CustomPoint) SetCount(i int64)
- func (p *CustomPoint) SetTimestamp(t int64)
- func (p *CustomPoint) SetValue(v float64)
- func (p *CustomPoint) SetValueNull()
- func (p *CustomPoint) ValueAdd(v float64)
- type Point
- type PostTransform
- type PreTransform
- type Settings
- type Stats
- func (st *Stats) Increment(metricName string, tags map[string]string, interval string, ...) error
- func (st *Stats) SetValue(metricName string, tags map[string]string, interval string, ...) error
- func (st *Stats) ValueAdd(metricName string, tags map[string]string, aggregation, interval string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomPoint ¶
type CustomPoint struct {
// contains filtered or unexported fields
}
CustomPoint is the base structure used by Point, CustomPoint should be used if you need more control over your stats.
func (*CustomPoint) GetCount ¶
func (p *CustomPoint) GetCount() int64
GetCount return the current count.
func (*CustomPoint) GetTimestamp ¶
func (p *CustomPoint) GetTimestamp() int64
GetTimestamp returns the current timestamp.
func (*CustomPoint) GetValue ¶
func (p *CustomPoint) GetValue() float64
GetValue return the current value.
func (*CustomPoint) IsValueNull ¶
func (p *CustomPoint) IsValueNull() bool
IsValueNull informs if the value is null or not.
func (*CustomPoint) Run ¶
func (p *CustomPoint) Run()
Run takes care of the logic for sending points
func (*CustomPoint) SetTimestamp ¶
func (p *CustomPoint) SetTimestamp(t int64)
SetTimestamp sets timestamp to t.
func (*CustomPoint) SetValueNull ¶
func (p *CustomPoint) SetValueNull()
SetValueNull sets the value to zero and the valNull boolean to true.
func (*CustomPoint) ValueAdd ¶
func (p *CustomPoint) ValueAdd(v float64)
ValueAdd adds v to value and increment the counter.
type Point ¶
type Point struct { Name string Metric string Tags map[string]string Aggregation string SendInterval string KeepValue bool SendOnNull bool Disabled bool }
Point holds information required by timeseries and also control variables for the stats package.
type PostTransform ¶
type PostTransform func(p *CustomPoint)
PostTransform is called just after the point is send.
type PreTransform ¶
type PreTransform func(p *CustomPoint) bool
PreTransform is called just before the point is send.
type Settings ¶
type Settings struct { Address string Port string Protocol string HTTPTimeout string HTTPPostInterval string Tags map[string]string KSID string Interval string Runtime bool }
Settings represents default package-wide settings.
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
Stats holds several informations. The timeseries backend address and port. The POST interval. The default tags to be added to all points and a map of all points.
func (*Stats) Increment ¶
func (st *Stats) Increment( metricName string, tags map[string]string, interval string, keep, nullable bool, ) error
Increment is a shorthand to ValueAdd with a value of one