Documentation ¶
Index ¶
- Variables
- type DB
- func (db *DB) Appender(_ context.Context) storage.Appender
- func (db *DB) ChunkQuerier(ctx context.Context, mint, maxt int64) (storage.ChunkQuerier, error)
- func (db *DB) Close() error
- func (db *DB) ExemplarQuerier(ctx context.Context) (storage.ExemplarQuerier, error)
- func (db *DB) Querier(ctx context.Context, mint, maxt int64) (storage.Querier, error)
- func (db *DB) StartTime() (int64, error)
- type Options
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) ChunkQuerier ¶
ChunkQuerier implements the Storage interface.
func (*DB) ExemplarQuerier ¶
ExemplarQuerier 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.
Click to show internal directories.
Click to hide internal directories.