Documentation ¶
Index ¶
- func NewEventTSExpiringSegment(capacity int) *eventTSExpiringSegment
- func SetLog(log *logging.Logger, trace bool)
- type EventTsExpiringBuffer
- type EventTsWithDataExpiringBuffer
- type EventTsWithIntExpiringBuffer
- type ExpiringBuffer
- type ExpiringSegment
- type ExpiringSegmentBase
- func (seg *ExpiringSegmentBase) GetPrev() ExpiringSegment
- func (seg *ExpiringSegmentBase) IsExpired(retentionPeriodMs uint64) bool
- func (seg *ExpiringSegmentBase) IsOpen(segDurationMs uint64) bool
- func (seg *ExpiringSegmentBase) IsOpen_(segDurationMs uint64) bool
- func (seg *ExpiringSegmentBase) SetPrev(prev ExpiringSegment)
- func (seg *ExpiringSegmentBase) Touch()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEventTSExpiringSegment ¶
func NewEventTSExpiringSegment(capacity int) *eventTSExpiringSegment
Types ¶
type EventTsExpiringBuffer ¶
type EventTsExpiringBuffer struct {
ExpiringBuffer
}
func NewEventTsExpiringBuffer ¶
func NewEventTsExpiringBuffer(id string, segDurationSec, retentionPeriodSec int) *EventTsExpiringBuffer
func (*EventTsExpiringBuffer) CountAll ¶
func (buf *EventTsExpiringBuffer) CountAll() (int, uint64)
func (*EventTsExpiringBuffer) RecordTS ¶
func (buf *EventTsExpiringBuffer) RecordTS()
type EventTsWithDataExpiringBuffer ¶
type EventTsWithDataExpiringBuffer struct {
ExpiringBuffer
}
func NewEventTsWithDataExpiringBuffer ¶
func NewEventTsWithDataExpiringBuffer(id string, segDurationSec, retentionPeriodSec int) *EventTsWithDataExpiringBuffer
func (*EventTsWithDataExpiringBuffer) ForEachEntry ¶
func (*EventTsWithDataExpiringBuffer) RecordTS ¶
func (buf *EventTsWithDataExpiringBuffer) RecordTS(data interface{})
type EventTsWithIntExpiringBuffer ¶
type EventTsWithIntExpiringBuffer struct {
ExpiringBuffer
}
func NewEventTsWithIntExpiringBuffer ¶
func NewEventTsWithIntExpiringBuffer(id string, segDurationSec, retentionPeriodSec int) *EventTsWithIntExpiringBuffer
func (*EventTsWithIntExpiringBuffer) ForEachEntry ¶
func (*EventTsWithIntExpiringBuffer) RecordInt ¶
func (buf *EventTsWithIntExpiringBuffer) RecordInt(num int)
type ExpiringBuffer ¶
type ExpiringBuffer struct {
// contains filtered or unexported fields
}
func NewExpiringBuffer ¶
func NewExpiringBuffer(id string, segDurationSec, retentionPeriodSec int, constructor func(prev ExpiringSegment) ExpiringSegment) *ExpiringBuffer
Thread safe through the lock of the whole buffer
func (*ExpiringBuffer) ForEachSegment__ ¶
func (buf *ExpiringBuffer) ForEachSegment__(callback func(seg ExpiringSegment) bool)
func (*ExpiringBuffer) GetID ¶
func (buf *ExpiringBuffer) GetID() string
func (*ExpiringBuffer) Lock ¶
func (buf *ExpiringBuffer) Lock()
func (*ExpiringBuffer) NewEntry ¶
func (buf *ExpiringBuffer) NewEntry(data ...interface{})
------------------ NOT THREAD SAFE
func (*ExpiringBuffer) Size ¶
func (buf *ExpiringBuffer) Size() (int, int)
func (*ExpiringBuffer) Unlock ¶
func (buf *ExpiringBuffer) Unlock()
type ExpiringSegment ¶
type ExpiringSegment interface { IsExpired(retentionPeriodMs uint64) bool IsOpen(segDurationMs uint64) bool GetPrev() ExpiringSegment SetPrev(ExpiringSegment) Put(data ...interface{}) Touch() Size() int }
--------------------------------------------
type ExpiringSegmentBase ¶
type ExpiringSegmentBase struct {
// contains filtered or unexported fields
}
---------------------------------
func NewExpiringSegmentBase ¶
func NewExpiringSegmentBase() *ExpiringSegmentBase
func (*ExpiringSegmentBase) GetPrev ¶
func (seg *ExpiringSegmentBase) GetPrev() ExpiringSegment
func (*ExpiringSegmentBase) IsExpired ¶
func (seg *ExpiringSegmentBase) IsExpired(retentionPeriodMs uint64) bool
func (*ExpiringSegmentBase) IsOpen ¶
func (seg *ExpiringSegmentBase) IsOpen(segDurationMs uint64) bool
func (*ExpiringSegmentBase) IsOpen_ ¶
func (seg *ExpiringSegmentBase) IsOpen_(segDurationMs uint64) bool
func (*ExpiringSegmentBase) SetPrev ¶
func (seg *ExpiringSegmentBase) SetPrev(prev ExpiringSegment)
func (*ExpiringSegmentBase) Touch ¶
func (seg *ExpiringSegmentBase) Touch()
Click to show internal directories.
Click to hide internal directories.