Documentation ¶
Index ¶
- type And
- type Filter
- type Key
- type No
- type Or
- type ScanCall
- type Timeseries
- func (ts *Timeseries) Add(m *models.Model) error
- func (ts *Timeseries) Close() error
- func (ts *Timeseries) Find(ctx context.Context, field models.Field, id uint64) (value string)
- func (ts *Timeseries) Get() *shards.DB
- func (ts *Timeseries) Location() *location.Location
- func (ts *Timeseries) Save() error
- func (ts *Timeseries) Scan(domainId uint64, res encoding.Resolution, start, end time.Time, filter Filter, ...) error
- func (ts *Timeseries) Search(field models.Field, prefix []byte, f func(key []byte, value uint64))
- func (ts *Timeseries) SearchKeys(field models.Field, prefix []byte, f func(key []byte) error) error
- func (ts *Timeseries) Select(ctx context.Context, values models.BitSet, domain string, start, end time.Time, ...) error
- func (ts *Timeseries) Translate(field models.Field, value []byte) uint64
- func (ts *Timeseries) Visitors(start, end time.Time, resolution encoding.Resolution, domain string) (visitors uint64)
- type Yes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Key ¶
type Timeseries ¶ added in v1.5.1
type Timeseries struct {
// contains filtered or unexported fields
}
func (*Timeseries) Add ¶ added in v1.5.1
func (ts *Timeseries) Add(m *models.Model) error
Add process m and batches it. It must be called in the same goroutine as (*Timeseries)Save
When we reach a shard boundary, existing batch will be saved before adding m. m []byte fields must not be modified because we use reference during translation A safe usage is to release m imediately after calling this method and reset it by calling
*m = models.Model{}
func (*Timeseries) Close ¶ added in v1.5.1
func (ts *Timeseries) Close() error
Close releases resources and removes buffers used.
func (*Timeseries) Get ¶ added in v1.5.1
func (ts *Timeseries) Get() *shards.DB
func (*Timeseries) Location ¶ added in v1.8.0
func (ts *Timeseries) Location() *location.Location
func (*Timeseries) Save ¶ added in v1.5.1
func (ts *Timeseries) Save() error
Save persist all buffered events into pebble key value store. This method is not safe for cocunrrent use. It is intended to be called in the same goroutine that calls (*Timeseries)Add.
The goal is to ensure almost lock free ingestion path ( with exception of translation with uses RWMutex)
func (*Timeseries) SearchKeys ¶ added in v1.10.0
func (*Timeseries) Translate ¶ added in v1.5.1
func (ts *Timeseries) Translate(field models.Field, value []byte) uint64
func (*Timeseries) Visitors ¶ added in v1.7.0
func (ts *Timeseries) Visitors(start, end time.Time, resolution encoding.Resolution, domain string) (visitors uint64)
Realtime computes total visitors in the last 5 minutes.