Documentation
¶
Index ¶
- type Cache
- type CleanStat
- type Cleaner
- type CleanerMetrics
- type ConcurrentCache
- func (c *ConcurrentCache[V]) Cleanup() uint64
- func (c *ConcurrentCache[V]) Evict(key uint32)
- func (c *ConcurrentCache[V]) Get(key uint32, l Loader[V]) (V, error)
- func (c *ConcurrentCache[V]) Release()
- func (c *ConcurrentCache[V]) Released() bool
- func (c *ConcurrentCache[V]) Reset(generation *Generation)
- func (c *ConcurrentCache[V]) SetGeneration(generation *Generation)
- type Generation
- type Loader
- type LoaderFunc
- type Metrics
- type Scan
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cleaner ¶
type Cleaner struct {
// contains filtered or unexported fields
}
func NewCleaner ¶
func NewCleaner(sizeLimit uint64, metrics *CleanerMetrics) *Cleaner
func (*Cleaner) CleanEmptyGenerations ¶
func (*Cleaner) ReleaseBuckets ¶
type CleanerMetrics ¶
type CleanerMetrics struct {
Oldest prometheus.Gauge
AddBuckets prometheus.Counter
DelBuckets prometheus.Counter
CleanGenerations prometheus.Counter
ChangeGenerations prometheus.Counter
}
func (*CleanerMetrics) BucketsInc ¶
func (m *CleanerMetrics) BucketsInc()
func (*CleanerMetrics) BucketsSub ¶
func (m *CleanerMetrics) BucketsSub(cnt int)
func (*CleanerMetrics) GenerationsInc ¶
func (m *CleanerMetrics) GenerationsInc()
func (*CleanerMetrics) GenerationsSub ¶
func (m *CleanerMetrics) GenerationsSub(cnt int)
func (*CleanerMetrics) OldestSet ¶
func (m *CleanerMetrics) OldestSet(nsec int64)
type ConcurrentCache ¶ added in v0.78.0
type ConcurrentCache[V any] struct { // contains filtered or unexported fields }
func NewConcurrentCache ¶ added in v0.78.0
func NewConcurrentCache[V any](cleaner *Cleaner, metrics *Metrics) *ConcurrentCache[V]
func (*ConcurrentCache[V]) Cleanup ¶ added in v0.78.0
func (c *ConcurrentCache[V]) Cleanup() uint64
func (*ConcurrentCache[V]) Evict ¶ added in v0.78.0
func (c *ConcurrentCache[V]) Evict(key uint32)
func (*ConcurrentCache[V]) Get ¶ added in v0.78.0
func (c *ConcurrentCache[V]) Get(key uint32, l Loader[V]) (V, error)
func (*ConcurrentCache[V]) Release ¶ added in v0.78.0
func (c *ConcurrentCache[V]) Release()
func (*ConcurrentCache[V]) Released ¶ added in v0.78.0
func (c *ConcurrentCache[V]) Released() bool
func (*ConcurrentCache[V]) Reset ¶ added in v0.78.0
func (c *ConcurrentCache[V]) Reset(generation *Generation)
Reset is used in tests only
func (*ConcurrentCache[V]) SetGeneration ¶ added in v0.78.0
func (c *ConcurrentCache[V]) SetGeneration(generation *Generation)
type Generation ¶
type Generation struct {
// contains filtered or unexported fields
}
func NewGeneration ¶
func NewGeneration() *Generation
type LoaderFunc ¶ added in v0.78.0
type Metrics ¶
type Metrics struct {
HitsTotal prometheus.Counter
MissTotal prometheus.Counter
PanicsTotal prometheus.Counter
LockWaitsTotal prometheus.Counter
WaitsTotal prometheus.Counter
ReattemptsTotal prometheus.Counter
SizeRead prometheus.Counter
SizeOccupied prometheus.Counter
SizeReleased prometheus.Counter
EntriesReleased prometheus.Counter
MapsRecreated prometheus.Counter
MissLatency prometheus.Counter
}
type Scan ¶ added in v0.78.0
type Scan[V any] struct { // contains filtered or unexported fields }
Scan wrapper is used exclusively for compaction to prevent unnecessary evictions from cache.
type Session ¶ added in v0.78.0
type Session[V any] struct { // contains filtered or unexported fields }
Session is a wrapper for ConcurrentCache which stores local copies of [entry] via weak pointers.
func NewSession ¶ added in v0.78.0
func NewSession[V any](c *ConcurrentCache[V]) *Session[V]
Click to show internal directories.
Click to hide internal directories.