Documentation
¶
Index ¶
- type Cache
- func (cache *Cache) Delete(key string) error
- func (cache *Cache) Discard(key string)
- func (cache *Cache) DiscardPrefix(prefix string) error
- func (cache *Cache) Evict(percent float64)
- func (cache *Cache) Flush()
- func (cache *Cache) GetOrCreate(key string) (interface{}, error)
- func (cache *Cache) Lookup(key string) (interface{}, bool)
- func (cache *Cache) Put(key string, val interface{})
- func (cache *Cache) Size() uint64
- func (cache *Cache) Sync() error
- func (cache *Cache) WriteBack()
- type Codec
- type Config
- type Metrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) DiscardPrefix ¶ added in v0.2.5
DiscardPrefix deletes all data that matches a certain prefix In both cache and database
func (*Cache) Evict ¶ added in v0.0.33
Evict performs cache evictions. The difference between Evict and WriteBack is that evictions happen when cache grows above allowed threshold and write-back calls happen constantly, making pyroscope more crash-resilient. See https://github.com/pyroscope-io/pyroscope/issues/210 for more context
func (*Cache) GetOrCreate ¶ added in v0.0.37
type Codec ¶ added in v0.0.40
type Codec interface {
Serialize(w io.Writer, key string, value interface{}) error
Deserialize(r io.Reader, key string) (interface{}, error)
// New returns a new instance of the type. The method is
// called by GetOrCreate when an item can not be found by
// the given key.
New(key string) interface{}
}
Codec is a shorthand of coder-decoder. A Codec implementation is responsible for type conversions and binary representation.
type Metrics ¶ added in v0.0.38
type Metrics struct {
MissesCounter prometheus.Counter
ReadsCounter prometheus.Counter
DBWrites prometheus.Observer
DBReads prometheus.Observer
WriteBackDuration prometheus.Observer
EvictionsDuration prometheus.Observer
}
Click to show internal directories.
Click to hide internal directories.