Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Bins bins = bins{ Total: Bin{Name: "total", Format: func(t time.Time) time.Time { return time.Unix(0, 0) }}, Year: Bin{Name: "y", Format: func(t time.Time) time.Time { return time.Date(t.Year(), 0, 0, 0, 0, 0, 0, t.Location()) }}, Month: Bin{Name: "m", Format: func(t time.Time) time.Time { return time.Date(t.Year(), t.Month(), 0, 0, 0, 0, 0, t.Location()) }}, Day: Bin{Name: "d", Format: func(t time.Time) time.Time { return time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, t.Location()) }}, Hour: Bin{Name: "h", Format: func(t time.Time) time.Time { return time.Date(t.Year(), t.Month(), t.Day(), t.Hour(), 0, 0, 0, t.Location()) }}, Minute: Bin{Name: "1min", Format: func(t time.Time) time.Time { return time.Date(t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), 0, 0, t.Location()) }}, }
Bins list of default bins
View Source
var ( // ErrNotImplemented means feature is not implemented yet ErrNotImplemented = errors.New("not implemented") )
Functions ¶
This section is empty.
Types ¶
type Bin ¶
type Bin struct { Name string // bin name e.g 1m, h, d, month, y Format func(t time.Time) time.Time // rounds time to particular time-series bin }
Bin keys
type Event ¶
type Event struct { Name string // contains filtered or unexported fields }
Event simple counter
type EventAvg ¶ added in v1.0.7
type EventAvg struct { Name string // contains filtered or unexported fields }
EventAvg calcs avg between increment executions
type EventConfig ¶ added in v1.0.4
EventConfig config params for event
type Mode ¶ added in v1.0.4
Mode mode manages storage behavior while writing keys
ModeDefault this mode writes every update to storage, bypassing cache
type Stata ¶
type Stata struct {
// contains filtered or unexported fields
}
Stata Stata realtime stat tool
func (*Stata) Event ¶
func (s *Stata) Event(name string, config EventConfig) *Event
Event creates new event
func (*Stata) EventAvg ¶ added in v1.0.7
func (s *Stata) EventAvg(name string, config EventConfig) *EventAvg
EventAvg creates avg event
type Storage ¶
type Storage struct { Get func(key Key) (Value, error) Set func(key Key, val Value) error GetRange func(keyRange KeyRange) ([]KeyValue, error) IncrBy func(keys []Key, value Value) error Clear func() error // removes data from storage }
Storage storage interface for stata
func NewMemoryStorage ¶ added in v1.0.4
func NewMemoryStorage() *Storage
NewMemoryStorage creates in-memory storage for stata counters
Click to show internal directories.
Click to hide internal directories.