Documentation ¶
Index ¶
- Variables
- type Accnt
- type AddPayload
- type AddsPayload
- type DelMetPayload
- type EvictTarget
- type FlatAccnt
- func (a *FlatAccnt) AddChunk(metric schema.AMKey, ts uint32, size uint64)
- func (a *FlatAccnt) AddChunks(metric schema.AMKey, chunks []chunk.IterGen)
- func (a *FlatAccnt) DelMetric(metric schema.AMKey)
- func (a *FlatAccnt) GetEvictQ() chan *EvictTarget
- func (a *FlatAccnt) GetTotal() uint64
- func (a *FlatAccnt) HitChunk(metric schema.AMKey, ts uint32)
- func (a *FlatAccnt) HitChunks(metric schema.AMKey, chunks []chunk.IterGen)
- func (a *FlatAccnt) Reset()
- func (a *FlatAccnt) Stop()
- type FlatAccntEvent
- type FlatAccntMet
- type GetTotalPayload
- type HitPayload
- type HitsPayload
- type LRU
- type Uint32Asc
Constants ¶
This section is empty.
Variables ¶
var ( // metric cache.ops.metric.hit-full is how many metrics were hit fully (all needed chunks in cache) CacheMetricHitFull = stats.NewCounterRate32("cache.ops.metric.hit-full") // metric cache.ops.metric.hit-partial is how many metrics were hit partially (some of the needed chunks in cache, but not all) CacheMetricHitPartial = stats.NewCounterRate32("cache.ops.metric.hit-partial") // metric cache.ops.metric.miss is how many metrics were missed fully (no needed chunks in cache) CacheMetricMiss = stats.NewCounterRate32("cache.ops.metric.miss") // metric cache.ops.chunk.hit is how many chunks were hit CacheChunkHit = stats.NewCounter32("cache.ops.chunk.hit") // metric cache.ops.chunk.push-hot is how many chunks have been pushed into the cache because their metric is hot CacheChunkPushHot = stats.NewCounter32("cache.ops.chunk.push-hot") )
var EventQSize = 100000
it's easily possible for many events to happen in one request, we never want this to fill up because otherwise events get dropped
Functions ¶
This section is empty.
Types ¶
type Accnt ¶
type Accnt interface { GetEvictQ() chan *EvictTarget AddChunk(metric schema.AMKey, ts uint32, size uint64) AddChunks(metric schema.AMKey, chunks []chunk.IterGen) HitChunk(metric schema.AMKey, ts uint32) HitChunks(metric schema.AMKey, chunks []chunk.IterGen) DelMetric(metric schema.AMKey) Stop() Reset() }
Accnt represents an instance of cache accounting. Currently there is only one implementation called `FlatAccnt`, but it could be replaced with alternative eviction algorithms in the future if they just implement this interface.
type AddPayload ¶
type AddPayload struct {
// contains filtered or unexported fields
}
payload to be sent with an add event
type AddsPayload ¶
type AddsPayload struct {
// contains filtered or unexported fields
}
payload to be sent with an add event
type DelMetPayload ¶
type DelMetPayload struct {
// contains filtered or unexported fields
}
payload to be sent with del metric event
type EvictTarget ¶
EvictTarget is the definition of a chunk that should be evicted.
type FlatAccnt ¶
type FlatAccnt struct {
// contains filtered or unexported fields
}
FlatAccnt implements Flat accounting. Keeps track of the chunk cache size and in which order the contained chunks have been used to last time. If it detects that the total cache size is above the given limit, it feeds the least recently used cache chunks into the evict queue, which will get consumed by the evict loop.
func NewFlatAccnt ¶
func (*FlatAccnt) GetEvictQ ¶
func (a *FlatAccnt) GetEvictQ() chan *EvictTarget
type FlatAccntEvent ¶
type FlatAccntEvent struct {
// contains filtered or unexported fields
}
type FlatAccntMet ¶
type FlatAccntMet struct {
// contains filtered or unexported fields
}
type GetTotalPayload ¶
type GetTotalPayload struct {
// contains filtered or unexported fields
}
payload to be sent with a get total request event
type HitPayload ¶
type HitPayload struct {
// contains filtered or unexported fields
}
payload to be sent with a hit event
type HitsPayload ¶
type HitsPayload struct {
// contains filtered or unexported fields
}
payload to be sent with a hits event