database

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBlockDuration = tsdb.DefaultBlockDuration
	DefaultRetention     = int64(90 * 24 * time.Hour / time.Millisecond)
)

Variables

This section is empty.

Functions

func GetCompatibleBlockDuration

func GetCompatibleBlockDuration(maxBlockDuration int64) int64

func MoveBlocks

func MoveBlocks(sourceDir string, destDir string) error

func NewTempDirectory

func NewTempDirectory(dir string, extension string) (string, error)

Types

type AppendManager

type AppendManager interface {
	NewAppender() (Appender, error)
	Close() error
}

type Appender

type Appender interface {
	Add(sample *promql.Sample) error
	// contains filtered or unexported methods
}

type Database

type Database interface {
	AppendManager() (AppendManager, error)
	QueryManager() (QueryManager, error)
	GetBlockDuration() int64
	Compact() error
	Close() error
}

func NewDatabase

func NewDatabase(dir string, blockDuration int64, retentionPeriod int64, ctx context.Context) (Database, error)

type Querier

type Querier interface {
	QueryRangeRule(ctx context.Context, recordingRule *config.RecordingRule, start int64, end int64, step int64) (RecordingRuleSampleIterator, error)
}

type QueryManager

type QueryManager interface {
	NewQuerier() Querier
	Close() error
}

type RecordingRuleSampleIterator

type RecordingRuleSampleIterator interface {
	Next() (bool, *promql.Sample)
}

Jump to

Keyboard shortcuts

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