Documentation ¶
Index ¶
- Constants
- Variables
- func AggregateHashPick(data AggregateHashData, fn MetricFn) float64
- func ByteMap(result interface{}, err error) (map[string][]byte, error)
- type AggregateHashData
- type Client
- func (c *Client) AddMetric(m *Metric) error
- func (c *Client) AddTimestep(t *Timestep) error
- func (c *Client) Graph(mgr MetricGraphRequest) (*MetricGraph, error)
- func (c *Client) GraphEachTag(mgr MetricGraphRequest, tag string, tag_values []string) ([]*MetricGraph, error)
- func (c *Client) Write(mv MetricValue) error
- type Metric
- type MetricFn
- type MetricGraph
- type MetricGraphRequest
- type MetricType
- type MetricValue
- type Time
- type Timestep
Constants ¶
View Source
const SEP = ":"
Variables ¶
View Source
var AggregateHash = `` /* 1088-byte string literal not displayed */
View Source
var DefaultMetric = MetricType{ Script: redis.NewScript(1, AggregateHash), }
View Source
var DefaultTimesteps = []*Timestep{ TimestepHour, TimestepDay, TimestepMonth, TimestepYear, }
View Source
var TimestepDay = &Timestep{ Name: "day", Key: "d", Period: Day, Keep: 2, NumSteps: 24, }
hourly for a day
View Source
var TimestepHour = &Timestep{ Name: "hour", Key: "h", Period: Hour, Keep: 2, NumSteps: 60, }
define some default normal steps hourly data with minute steps
View Source
var TimestepMonth = &Timestep{ Name: "month", Key: "m", Period: Month, Keep: 2, NumSteps: 30, }
daily for a month
View Source
var TimestepYear = &Timestep{ Name: "year", Key: "y", Period: Year, Keep: 2, NumSteps: 12, }
monthly for a year
Functions ¶
func AggregateHashPick ¶
func AggregateHashPick(data AggregateHashData, fn MetricFn) float64
Types ¶
type AggregateHashData ¶
func AggregateHashUnpack ¶
func AggregateHashUnpack(data []byte) (AggregateHashData, error)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddTimestep ¶
func (*Client) Graph ¶
func (c *Client) Graph(mgr MetricGraphRequest) (*MetricGraph, error)
func (*Client) GraphEachTag ¶
func (c *Client) GraphEachTag(mgr MetricGraphRequest, tag string, tag_values []string) ([]*MetricGraph, error)
func (*Client) Write ¶
func (c *Client) Write(mv MetricValue) error
type Metric ¶
type Metric struct { Name string Key string Tags []string Steps []*Timestep Type MetricType }
func (*Metric) Graph ¶
func (m *Metric) Graph(conn redis.Conn, mgr MetricGraphRequest) (*MetricGraph, error)
func (*Metric) WriteFloat ¶
func (m *Metric) WriteFloat(conn redis.Conn, mv MetricValue) error
type MetricGraph ¶
type MetricGraph struct { Tags map[string]string `json:"tags"` Values [][2]float64 `json:"values"` }
func (*MetricGraph) Spark ¶
func (mg *MetricGraph) Spark() []float64
func (*MetricGraph) SparkString ¶
func (mg *MetricGraph) SparkString() string
type MetricGraphRequest ¶
type MetricType ¶
type MetricValue ¶
type Timestep ¶
func (*Timestep) PeriodStepList ¶
Click to show internal directories.
Click to hide internal directories.