Documentation ¶
Overview ¶
Package storage handles in memory storage and searching for time series elements. Multiple goroutines handle search and storage of time series elements each of which is mapped to a unique key. Keys and associated elements are distributed to goroutines to reduce lock contention.
Index ¶
Constants ¶
View Source
const ( // DefaultMaxAge default amount of time we keep elements DefaultMaxAge = 61 * time.Minute // DefaultWorkerCount is the default number of workers to use to handle data DefaultWorkerCount = 256 // DefaultChannelBufferSize is the default buffer size for work channels DefaultChannelBufferSize = 100 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorInvalidSearch ¶
type ErrorInvalidSearch struct{}
func (*ErrorInvalidSearch) Error ¶
func (e *ErrorInvalidSearch) Error() string
func (*ErrorInvalidSearch) InvalidSearch ¶
func (e *ErrorInvalidSearch) InvalidSearch()
type ErrorNotFound ¶
type ErrorNotFound struct {
Key string
}
func (*ErrorNotFound) Error ¶
func (n *ErrorNotFound) Error() string
func (*ErrorNotFound) NotFound ¶
func (n *ErrorNotFound) NotFound()
type ExpiryHandler ¶
ExpiryHandler is a callback that will receive time series elements when they expire. This can be used to aggregate and persist old elements.
type InvalidSearch ¶
type InvalidSearch interface {
InvalidSearch()
}
type KeyNotFound ¶
type KeyNotFound interface {
NotFound()
}
type Options ¶
type Options struct { // MaxAge time series elements older than this will be discarded. MaxAge time.Duration // WorkerCount is the number of goroutines that process incoming messages. WorkerCount int // ChannelBufferSize is the number of jobs that can be buffered in the jobs channel to improve throughput and async processing. ChannelBufferSize int // OnExpire is an optional method that is called when a time series element expires. This could be used to // aggregate expiring elements into courser granularity or to write to persistent storage. OnExpire ExpiryHandler // MessageCounter keeps tally of the number of messages that have arrived. MessageCounter metrics.Counter }
Options for storage of time series.
Click to show internal directories.
Click to hide internal directories.