Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CounterSlice ¶
type CounterSlice []Counter
CounterSlice is a slice of counters
func (CounterSlice) FilterZero ¶
func (s CounterSlice) FilterZero() CounterSlice
FilterZero filters out empty counters in-place
type Counters ¶
type Counters struct {
// contains filtered or unexported fields
}
Counters is an index of counters safe for councurrent use
func NewCounters ¶
NewCounters creates a new counter index of size capacity
func (*Counters) Merge ¶
func (cs *Counters) Merge(s CounterSlice)
Merge adds all counters from a CounterSlice
type UnsafeCounters ¶
type UnsafeCounters struct {
// contains filtered or unexported fields
}
UnsafeCounters is an index of counters not safe for concurrent use
func (*UnsafeCounters) Add ¶
func (cs *UnsafeCounters) Add(n int64, values ...string) int64
Add increments a counter matching values by n
func (*UnsafeCounters) Flush ¶
func (cs *UnsafeCounters) Flush(s CounterSlice) CounterSlice
Flush appends all counters to a snapshot and resets them to zero
func (*UnsafeCounters) Get ¶
func (cs *UnsafeCounters) Get(i int) *Counter
Get returns the counter at index i
func (*UnsafeCounters) Len ¶
func (cs *UnsafeCounters) Len() int
Len returns the number of counters in an Event
func (*UnsafeCounters) Pack ¶
func (cs *UnsafeCounters) Pack()
Pack packs the counter index dropping zero counters
Click to show internal directories.
Click to hide internal directories.