Documentation
¶
Index ¶
- Constants
- type Cache
- type ElasticQueue
- type MetricState
- type MetricsCache
- func (mc *MetricsCache) Add(lset utils.LabelsIfc, t int64, v interface{}) (uint64, error)
- func (mc *MetricsCache) AddFast(ref uint64, t int64, v interface{}) error
- func (mc *MetricsCache) Close()
- func (mc *MetricsCache) Start() error
- func (mc *MetricsCache) WaitForCompletion(timeout time.Duration) (int, error)
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 (*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
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) 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)
Click to show internal directories.
Click to hide internal directories.