Documentation ¶
Overview ¶
Package pathteststore handle pathtest storage
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PathtestContext ¶
PathtestContext contains Pathtest information and additional flush related data
func (*PathtestContext) LastFlushInterval ¶
func (p *PathtestContext) LastFlushInterval() time.Duration
LastFlushInterval returns last flush interval
func (*PathtestContext) SetLastFlushInterval ¶
func (p *PathtestContext) SetLastFlushInterval(lastFlushInterval time.Duration)
SetLastFlushInterval sets last flush interval
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is used to accumulate aggregated contexts
func NewPathtestStore ¶
func NewPathtestStore(pathtestTTL time.Duration, pathtestInterval time.Duration, contextsLimit int, logger log.Component) *Store
NewPathtestStore creates a new Store
func (*Store) Flush ¶
func (f *Store) Flush() []*PathtestContext
Flush will flush specific Pathtest context (distinct hash) if nextRun is reached once a Pathtest context is flushed nextRun will be updated to the next flush time
ttl: ttl defines the duration we should keep a specific PathtestContext in `Store.contexts` after `lastSuccessfulFlush`. // Flow context in `Store.contexts` map will be deleted if `ttl` is reached to avoid keeping Pathtest context that are not seen anymore. We need to keep PathtestContext (contains `nextRun` and `lastSuccessfulFlush`) after flush to be able to flush at regular interval (`flushInterval`). Example, after a flush, PathtestContext will have a new nextRun, that will be the next flush time for new contexts being added.
func (*Store) GetContextsCount ¶
GetContextsCount returns pathtest contexts count