Documentation ¶
Index ¶
- type CounterInterface
- type CounterItem
- type CustomCounter
- func (this *CustomCounter) Add(f func(v CounterItem), t ...time.Time)
- func (this *CustomCounter) Capacity() int
- func (this *CustomCounter) GetAll(rtrimZero ...bool) []CounterItem
- func (this *CustomCounter) GetN(t time.Time, offset, limit int, rtrimZero ...bool) []CounterItem
- func (this *CustomCounter) Name() string
- func (this *CustomCounter) Round() time.Duration
- type MRTCountValue
- type MRTCounterItem
- type PropertyCounter
- func (this *PropertyCounter) Add(property string, n int, t ...time.Time)
- func (this *PropertyCounter) GetAll(rtrimZero ...bool) []CounterItem
- func (this *PropertyCounter) ItemProperties() []string
- func (this *PropertyCounter) Max(property string, n int, t ...time.Time)
- func (this *PropertyCounter) Min(property string, n int, t ...time.Time)
- func (this *PropertyCounter) Name() string
- func (this *PropertyCounter) Round() time.Duration
- func (this *PropertyCounter) Set(property string, n int, t ...time.Time)
- func (this *PropertyCounter) SetPropertyNames(autoSort bool, property ...string) *PropertyCounter
- type PropertyCounterInterface
- type PropertyCounterItem
- type PropertyMRTCounter
- func (this *PropertyMRTCounter) Add(property string, n int, d time.Duration, t ...time.Time)
- func (this *PropertyMRTCounter) AddF(f func(a *PropertyMrtCountItem))
- func (this *PropertyMRTCounter) GetAll(rtrimZero ...bool) []CounterItem
- func (this *PropertyMRTCounter) GetAllMRT(rtrimZero ...bool) []MRTCounterItem
- func (this *PropertyMRTCounter) ItemProperties() []string
- func (this *PropertyMRTCounter) Name() string
- func (this *PropertyMRTCounter) Round() time.Duration
- func (this *PropertyMRTCounter) Set(property string, n int, d time.Duration, t ...time.Time)
- func (this *PropertyMRTCounter) SetPropertyNames(autoSort bool, property ...string) *PropertyMRTCounter
- type PropertyMrtCountItem
- func (this *PropertyMrtCountItem) Add(property string, n int, d time.Duration)
- func (this *PropertyMrtCountItem) IsZero() bool
- func (this *PropertyMrtCountItem) MRTValues() []*MRTCountValue
- func (this *PropertyMrtCountItem) Properties() []string
- func (this *PropertyMrtCountItem) Reset()
- func (this *PropertyMrtCountItem) Set(property string, n int, d time.Duration)
- func (this *PropertyMrtCountItem) Values() []interface{}
- type SimpleCounter
- type StepMRTCounter
- func (this *StepMRTCounter) Add(n int, d time.Duration, t ...time.Time)
- func (this *StepMRTCounter) GetAll(rtrimZero ...bool) []CounterItem
- func (this *StepMRTCounter) GetAllMRT(rtrimZero ...bool) []MRTCounterItem
- func (this *StepMRTCounter) ItemProperties() []string
- func (this *StepMRTCounter) Name() string
- func (this *StepMRTCounter) Round() time.Duration
- func (this *StepMRTCounter) SetStepFormat(f func(step time.Duration) string) *StepMRTCounter
- func (this *StepMRTCounter) Steps() []time.Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CounterInterface ¶
type CounterInterface interface { Name() string Round() time.Duration GetAll(rtrimZero ...bool) []CounterItem }
func AllNamedCounter ¶
func AllNamedCounter() []CounterInterface
type CounterItem ¶
type CounterItem interface { IsZero() bool Reset() }
type CustomCounter ¶
type CustomCounter struct {
// contains filtered or unexported fields
}
func NewCustom ¶
func NewCustom(name string, round time.Duration, capacity int, newItem func() CounterItem) *CustomCounter
func (*CustomCounter) Add ¶
func (this *CustomCounter) Add(f func(v CounterItem), t ...time.Time)
设置计数器的值
Perf:
[perf-1s] total=14877334, avg=14877334/s, mrt=67ns
func (*CustomCounter) Capacity ¶
func (this *CustomCounter) Capacity() int
func (*CustomCounter) GetAll ¶
func (this *CustomCounter) GetAll(rtrimZero ...bool) []CounterItem
Perf:
[perf-1s] total=1720411, avg=1720411/s, mrt=581ns
func (*CustomCounter) GetN ¶
func (this *CustomCounter) GetN(t time.Time, offset, limit int, rtrimZero ...bool) []CounterItem
func (*CustomCounter) Name ¶
func (this *CustomCounter) Name() string
func (*CustomCounter) Round ¶
func (this *CustomCounter) Round() time.Duration
type MRTCountValue ¶
type MRTCounterItem ¶
type MRTCounterItem interface { CounterItem MRTValues() []*MRTCountValue }
type PropertyCounter ¶
type PropertyCounter struct {
// contains filtered or unexported fields
}
func NewProperty ¶
func NewProperty(name string, round time.Duration, capacity int) *PropertyCounter
func (*PropertyCounter) Add ¶
func (this *PropertyCounter) Add(property string, n int, t ...time.Time)
func (*PropertyCounter) GetAll ¶
func (this *PropertyCounter) GetAll(rtrimZero ...bool) []CounterItem
func (*PropertyCounter) ItemProperties ¶
func (this *PropertyCounter) ItemProperties() []string
func (*PropertyCounter) Max ¶
func (this *PropertyCounter) Max(property string, n int, t ...time.Time)
func (*PropertyCounter) Min ¶
func (this *PropertyCounter) Min(property string, n int, t ...time.Time)
func (*PropertyCounter) Name ¶
func (this *PropertyCounter) Name() string
func (*PropertyCounter) Round ¶
func (this *PropertyCounter) Round() time.Duration
func (*PropertyCounter) Set ¶
func (this *PropertyCounter) Set(property string, n int, t ...time.Time)
func (*PropertyCounter) SetPropertyNames ¶
func (this *PropertyCounter) SetPropertyNames(autoSort bool, property ...string) *PropertyCounter
type PropertyCounterInterface ¶
type PropertyCounterInterface interface { CounterInterface ItemProperties() []string }
type PropertyCounterItem ¶
type PropertyCounterItem interface { CounterItem Values() []interface{} }
type PropertyMRTCounter ¶
type PropertyMRTCounter struct {
// contains filtered or unexported fields
}
func NewPropertyMRT ¶
func NewPropertyMRT(name string, round time.Duration, capacity int) *PropertyMRTCounter
func (*PropertyMRTCounter) AddF ¶
func (this *PropertyMRTCounter) AddF(f func(a *PropertyMrtCountItem))
func (*PropertyMRTCounter) GetAll ¶
func (this *PropertyMRTCounter) GetAll(rtrimZero ...bool) []CounterItem
func (*PropertyMRTCounter) GetAllMRT ¶
func (this *PropertyMRTCounter) GetAllMRT(rtrimZero ...bool) []MRTCounterItem
func (*PropertyMRTCounter) ItemProperties ¶
func (this *PropertyMRTCounter) ItemProperties() []string
func (*PropertyMRTCounter) Name ¶
func (this *PropertyMRTCounter) Name() string
func (*PropertyMRTCounter) Round ¶
func (this *PropertyMRTCounter) Round() time.Duration
func (*PropertyMRTCounter) SetPropertyNames ¶
func (this *PropertyMRTCounter) SetPropertyNames(autoSort bool, property ...string) *PropertyMRTCounter
type PropertyMrtCountItem ¶
type PropertyMrtCountItem struct {
// contains filtered or unexported fields
}
func (*PropertyMrtCountItem) Add ¶
func (this *PropertyMrtCountItem) Add(property string, n int, d time.Duration)
func (*PropertyMrtCountItem) IsZero ¶
func (this *PropertyMrtCountItem) IsZero() bool
func (*PropertyMrtCountItem) MRTValues ¶
func (this *PropertyMrtCountItem) MRTValues() []*MRTCountValue
func (*PropertyMrtCountItem) Properties ¶
func (this *PropertyMrtCountItem) Properties() []string
func (*PropertyMrtCountItem) Reset ¶
func (this *PropertyMrtCountItem) Reset()
func (*PropertyMrtCountItem) Set ¶
func (this *PropertyMrtCountItem) Set(property string, n int, d time.Duration)
func (*PropertyMrtCountItem) Values ¶
func (this *PropertyMrtCountItem) Values() []interface{}
type SimpleCounter ¶
type SimpleCounter struct {
// contains filtered or unexported fields
}
func (*SimpleCounter) GetAll ¶
func (this *SimpleCounter) GetAll(rtrimZero ...bool) []CounterItem
func (*SimpleCounter) ItemProperties ¶
func (this *SimpleCounter) ItemProperties() []string
func (*SimpleCounter) Name ¶
func (this *SimpleCounter) Name() string
func (*SimpleCounter) Round ¶
func (this *SimpleCounter) Round() time.Duration
type StepMRTCounter ¶
type StepMRTCounter struct {
// contains filtered or unexported fields
}
func NewStepMRT ¶
func (*StepMRTCounter) GetAll ¶
func (this *StepMRTCounter) GetAll(rtrimZero ...bool) []CounterItem
func (*StepMRTCounter) GetAllMRT ¶
func (this *StepMRTCounter) GetAllMRT(rtrimZero ...bool) []MRTCounterItem
func (*StepMRTCounter) ItemProperties ¶
func (this *StepMRTCounter) ItemProperties() []string
func (*StepMRTCounter) Name ¶
func (this *StepMRTCounter) Name() string
func (*StepMRTCounter) Round ¶
func (this *StepMRTCounter) Round() time.Duration
func (*StepMRTCounter) SetStepFormat ¶
func (this *StepMRTCounter) SetStepFormat(f func(step time.Duration) string) *StepMRTCounter
func (*StepMRTCounter) Steps ¶
func (this *StepMRTCounter) Steps() []time.Duration
Click to show internal directories.
Click to hide internal directories.