timeseries

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2024 License: AGPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cond added in v1.6.0

type Cond struct {
	Yes []uint64
	No  []uint64
}

Cond defines exact matches rows and non exact match rows. Applies a union of all columns satsfying the conditions.

This assumes Cond is for a mutex field. vince only support filter on mutex fields.

func (*Cond) Apply added in v1.6.0

func (f *Cond) Apply(shard uint64, cu *cursor.Cursor, exists *ro2.Bitmap) *ro2.Bitmap

Apply searches for columns matching conditions in f for ra bitmap. ra must be mutex encoded.

func (*Cond) IsEmpty added in v1.6.0

func (f *Cond) IsEmpty() bool

IsEmpty return true if there is no row in yes or no conditions.

type FilterSet added in v1.6.0

type FilterSet [models.SearchFieldSize]Cond

func (*FilterSet) ScanFields added in v1.6.0

func (fs *FilterSet) ScanFields() (set models.BitSet)

ScanFields returns a set of all fields to scan for this filter.

func (*FilterSet) Set added in v1.6.0

func (fs *FilterSet) Set(yes bool, f models.Field, values ...uint64)

type Key

type Key struct {
	View       uint64
	Resolution encoding.Resolution
	Field      models.Field
	Existence  bool
}

func (*Key) Encode added in v1.9.0

func (k *Key) Encode(co uint64, b []byte) []byte

type ScanCall added in v1.8.0

type ScanCall func(cu *cursor.Cursor, field models.Field, view, shard uint64, columns *ro2.Bitmap) error

type ScanConfig added in v1.6.0

type ScanConfig struct {
	All, Data, Filter struct {
		Set models.BitSet
	}
}

type Timeseries added in v1.5.1

type Timeseries struct {
	// contains filtered or unexported fields
}

func New added in v1.5.1

func New(db *shards.DB, lo *location.Location) *Timeseries

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) Find added in v1.5.1

func (ts *Timeseries) Find(ctx context.Context, field models.Field, id uint64) (value string)

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) Scan added in v1.6.0

func (ts *Timeseries) Scan(
	domainId uint64,
	res encoding.Resolution,
	start, end time.Time,
	filterSet FilterSet,
	valueSet models.BitSet,
	cb ScanCall,
) error

func (*Timeseries) Search added in v1.5.1

func (ts *Timeseries) Search(field models.Field, prefix []byte, f func(key []byte, value uint64))

func (*Timeseries) Select added in v1.5.1

func (ts *Timeseries) Select(
	ctx context.Context,
	values models.BitSet,
	domain string, start,
	end time.Time,
	intrerval query.Interval,
	filters query.Filters,
	cb ScanCall) error

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL