Documentation ¶
Index ¶
- Variables
- type DB
- func (db *DB) Appender(context.Context) storage.Appender
- func (db *DB) ChunkQuerier(int64, int64) (storage.ChunkQuerier, error)
- func (db *DB) Close() error
- func (db *DB) ExemplarQuerier(context.Context) (storage.ExemplarQuerier, error)
- func (db *DB) Querier(int64, int64) (storage.Querier, error)
- func (db *DB) SetWriteNotified(wn wlog.WriteNotified)
- 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.
func (*DB) SetWriteNotified ¶
func (db *DB) SetWriteNotified(wn wlog.WriteNotified)
SetWriteNotified allows to set an instance to notify when a write happens. It must be used during initialization. It is not safe to use it during execution.
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 configures the compression type to use on records in the WAL. WALCompression wlog.CompressionType // 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 reasonable for setups using millisecond-precision timestamps.
Click to show internal directories.
Click to hide internal directories.