appender

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 20 Imported by: 8

Documentation

Overview

Copyright 2018 Iguazio Systems Ltd.

Licensed under the Apache License, Version 2.0 (the "License") with an addition restriction as set forth herein. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

In addition, you may not use the software for any purposes that are illegal under applicable law, and the grant of the foregoing license under the Apache 2.0 license is conditioned upon your compliance with such restriction.

Index

Constants

View Source
const ListSize = 256

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache added in v0.11.3

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

Cache is an LRU cache. It is not safe for concurrent access.

func NewCache added in v0.11.3

func NewCache(max int) *Cache

func (*Cache) Add added in v0.11.3

func (c *Cache) Add(key uint64, value *MetricState)

Add adds a value to the cache.

func (*Cache) Get added in v0.11.3

func (c *Cache) Get(key uint64) (value *MetricState, ok bool)

Get looks up a key's value from the cache.

func (*Cache) ResetMetric added in v0.11.3

func (c *Cache) ResetMetric(key uint64)

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