storecache

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexCache

type IndexCache struct {
	// contains filtered or unexported fields
}

func NewIndexCache

func NewIndexCache(logger log.Logger, reg prometheus.Registerer, opts Opts) (*IndexCache, error)

NewIndexCache creates a new thread-safe LRU cache for index entries and ensures the total cache size approximately does not exceed maxBytes.

func (*IndexCache) Postings

func (c *IndexCache) Postings(b ulid.ULID, l labels.Label) ([]byte, bool)

func (*IndexCache) Series

func (c *IndexCache) Series(b ulid.ULID, id uint64) ([]byte, bool)

func (*IndexCache) SetPostings

func (c *IndexCache) SetPostings(b ulid.ULID, l labels.Label, v []byte)

func (*IndexCache) SetSeries

func (c *IndexCache) SetSeries(b ulid.ULID, id uint64, v []byte)

type Opts

type Opts struct {
	// MaxSizeBytes represents overall maximum number of bytes cache can contain.
	MaxSizeBytes uint64
	// MaxItemSizeBytes represents maximum size of single item.
	MaxItemSizeBytes uint64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL