appender

package
v0.10.9 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2020 License: Apache-2.0 Imports: 18 Imported by: 8

Documentation

Index

Constants

View Source
const ListSize = 256

Variables

This section is empty.

Functions

This section is empty.

Types

type ElasticQueue added in v0.0.3

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

func NewElasticQueue added in v0.0.3

func NewElasticQueue() *ElasticQueue

Elastic Queue, a fifo queue with dynamic resize

func (*ElasticQueue) IsEmpty added in v0.0.3

func (eq *ElasticQueue) IsEmpty() bool

Is the queue empty

func (*ElasticQueue) Length added in v0.0.3

func (eq *ElasticQueue) Length() int

Number of elements in the queue

func (*ElasticQueue) Pop added in v0.0.3

func (eq *ElasticQueue) Pop() *MetricState

func (*ElasticQueue) PopN added in v0.0.3

func (eq *ElasticQueue) PopN(length int) []*MetricState

func (*ElasticQueue) Push added in v0.0.3

func (eq *ElasticQueue) Push(val *MetricState) int

func (*ElasticQueue) Rotate added in v0.0.3

func (eq *ElasticQueue) Rotate(val *MetricState) (*MetricState, int)

Atomic rotate, push a value to the tail and pop one from the head

type MetricState

type MetricState struct {
	sync.RWMutex

	Lset utils.LabelsIfc
	// contains filtered or unexported fields
}

to add, rollups policy (cnt, sum, min/max, sum^2) + interval , or policy in per name label

type MetricsCache

type MetricsCache struct {
	NameLabelMap map[string]bool // temp store all lable names
	// contains filtered or unexported fields
}

store the state and metadata for all the metrics

func NewMetricsCache

func NewMetricsCache(container v3io.Container, logger logger.Logger, cfg *config.V3ioConfig,
	partMngr *partmgr.PartitionManager) *MetricsCache

func (*MetricsCache) Add

func (mc *MetricsCache) Add(lset utils.LabelsIfc, t int64, v interface{}) (uint64, error)

First time add time & value to metric (by label set)

func (*MetricsCache) AddFast

func (mc *MetricsCache) AddFast(ref uint64, t int64, v interface{}) error

fast Add to metric (by refID)

func (*MetricsCache) Close added in v0.9.14

func (mc *MetricsCache) Close()

func (*MetricsCache) Start added in v0.0.3

func (mc *MetricsCache) Start() error

func (*MetricsCache) WaitForCompletion added in v0.0.3

func (mc *MetricsCache) WaitForCompletion(timeout time.Duration) (int, error)

Jump to

Keyboard shortcuts

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