agent

package
v0.40.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 26 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultTruncateFrequency = 2 * time.Hour
	DefaultMinWALTime        = int64(5 * time.Minute / time.Millisecond)
	DefaultMaxWALTime        = int64(4 * time.Hour / time.Millisecond)
)

Default values for options.

View Source
var ErrUnsupported = errors.New("unsupported operation with WAL-only storage")

Functions

This section is empty.

Types

type DB

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

DB represents a WAL-only storage. It implements storage.DB.

func Open

func Open(l log.Logger, reg prometheus.Registerer, rs *remote.Storage, dir string, opts *Options) (*DB, error)

Open returns a new agent.DB in the given directory.

func (*DB) Appender

func (db *DB) Appender(_ context.Context) storage.Appender

Appender implements storage.Storage.

func (*DB) ChunkQuerier

func (db *DB) ChunkQuerier(ctx context.Context, mint, maxt int64) (storage.ChunkQuerier, error)

ChunkQuerier implements the Storage interface.

func (*DB) Close

func (db *DB) Close() error

Close implements the Storage interface.

func (*DB) ExemplarQuerier

func (db *DB) ExemplarQuerier(ctx context.Context) (storage.ExemplarQuerier, error)

ExemplarQuerier implements the Storage interface.

func (*DB) Querier

func (db *DB) Querier(ctx context.Context, mint, maxt int64) (storage.Querier, error)

Querier implements the Storage interface.

func (*DB) StartTime

func (db *DB) StartTime() (int64, error)

StartTime implements the Storage interface.

type Options

type Options struct {
	// Segments (wal files) max size.
	// WALSegmentSize <= 0, segment size is default size.
	// WALSegmentSize > 0, segment size is WALSegmentSize.
	WALSegmentSize int

	// WALCompression will turn on Snappy compression for records on the WAL.
	WALCompression bool

	// StripeSize is the size (power of 2) in entries of the series hash map. Reducing the size will save memory but impact performance.
	StripeSize int

	// TruncateFrequency determines how frequently to truncate data from the WAL.
	TruncateFrequency time.Duration

	// Shortest and longest amount of time data can exist in the WAL before being
	// deleted.
	MinWALTime, MaxWALTime int64

	// NoLockfile disables creation and consideration of a lock file.
	NoLockfile bool
}

Options of the WAL storage.

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions used for the WAL storage. They are sane for setups using millisecond-precision timestamps.

Jump to

Keyboard shortcuts

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