Documentation
¶
Index ¶
- type Cache
- func (c *Cache[V]) Cleanup() uint64
- func (c *Cache[V]) Get(key uint32, fn func() (V, int)) V
- func (c *Cache[V]) GetWithError(key uint32, fn func() (V, int, error)) (V, error)
- func (c *Cache[V]) Release()
- func (c *Cache[V]) Released() bool
- func (c *Cache[V]) Reset(generation *Generation)
- func (c *Cache[V]) SetGeneration(generation *Generation)
- type CleanStat
- type Cleaner
- type CleanerMetrics
- type Generation
- type Metrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[V any] struct { // contains filtered or unexported fields }
func (*Cache[V]) GetWithError ¶
func (*Cache[V]) Reset ¶
func (c *Cache[V]) Reset(generation *Generation)
Reset is used in tests only
func (*Cache[V]) SetGeneration ¶
func (c *Cache[V]) SetGeneration(generation *Generation)
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 Generation ¶
type Generation struct {
// contains filtered or unexported fields
}
func NewGeneration ¶
func NewGeneration() *Generation
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
MapsRecreated prometheus.Counter
MissLatency prometheus.Counter
}
Click to show internal directories.
Click to hide internal directories.