cache

package
v1.17.9 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryConcurrency   = 10
	BackFillInterval   = 4 * timeseries.Hour
	MinRefreshInterval = timeseries.Minute
)

Variables

View Source
var DefaultCompactionConfig = CompactionConfig{
	Interval:   timeseries.Second * 10,
	WorkersNum: 1,
	Compactors: []Compactor{
		{SrcChunkDuration: chunk.Size, DstChunkDuration: timeseries.Hour},
		{SrcChunkDuration: timeseries.Hour, DstChunkDuration: 4 * timeseries.Hour},
		{SrcChunkDuration: 4 * timeseries.Hour, DstChunkDuration: 12 * timeseries.Hour},
	},
}

Functions

func QueryId

func QueryId(projectId db.ProjectId, query string) (string, timeseries.Duration)

Types

type Cache

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

func NewCache

func NewCache(cfg Config, database *db.DB, globalPrometheus *db.IntegrationPrometheus, globalClickHouse *db.IntegrationClickhouse) (*Cache, error)

func (*Cache) GetCacheClient

func (c *Cache) GetCacheClient(projectId db.ProjectId) *Client

func (*Cache) Updates added in v0.22.0

func (c *Cache) Updates() <-chan db.ProjectId

type Client

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

func (*Client) GetStatus

func (c *Client) GetStatus() (*Status, error)

func (*Client) GetStep added in v0.17.7

func (c *Client) GetStep(from, to timeseries.Time) (timeseries.Duration, error)

func (*Client) GetTo

func (c *Client) GetTo() (timeseries.Time, error)

func (*Client) QueryRange

func (c *Client) QueryRange(ctx context.Context, query string, from, to timeseries.Time, step timeseries.Duration, fillFunc timeseries.FillFunc) ([]*model.MetricValues, error)

type CompactionConfig

type CompactionConfig struct {
	Interval   timeseries.Duration `yaml:"interval"`
	WorkersNum int                 `yaml:"workers_num"`

	Compactors []Compactor `yaml:"compactors"`
}

type CompactionTask

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

func (CompactionTask) String

func (ct CompactionTask) String() string

type Compactor

type Compactor struct {
	SrcChunkDuration timeseries.Duration `yaml:"src_chunk_duration_seconds"`
	DstChunkDuration timeseries.Duration `yaml:"dst_chunk_duration_seconds"`
}

type Config

type Config struct {
	Path       string
	GC         *GcConfig
	Compaction *CompactionConfig
}

type GcConfig

type GcConfig struct {
	Interval timeseries.Duration `yaml:"interval"`
	TTL      timeseries.Duration `yaml:"ttl"`
}

type PrometheusQueryState

type PrometheusQueryState struct {
	ProjectId db.ProjectId
	Query     string
	LastTs    timeseries.Time
	LastError string
}

func (*PrometheusQueryState) Migrate

func (p *PrometheusQueryState) Migrate(m *db.Migrator) error

type Status

type Status struct {
	Error  string
	LagMax timeseries.Duration
	LagAvg timeseries.Duration
}

type UpdateTask added in v1.8.7

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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