Documentation ¶
Overview ¶
Package metricdb handles the metrics storage.
The DB contains multiple leveldb instances, a new leveldb instance would be created and also an old instance would be expired every day.
File Structure ¶
Example file structure for period=1day, expiration=7days:
storage/ (period=1day, expiration=7days) |- admindb |- indexdb/ |- metricdb/ |- 16912 -- Outdated |- 16913 -- -7 |- 16914 -- -6 |- 16915 -- -5 |- 16916 -- -4 |- 16917 -- -3 |- 16918 -- -2 |- 16919 -- -1 |- 16920 -- Active
Entry Format ¶
Key-Value design in leveldb:
|------- Key (8) ------|-------------- Value (24) -----------| +----------+-----------+-----------+-----------+-------------+ | Link (4) | Stamp (4) | Value (8) | Score (8) | Average (8) | +----------+-----------+-----------+-----------+-------------+
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is returned when requested data not found. ErrNotFound = errors.New("metricdb: not found") // ErrCorrupted is returned when corrupted data found. ErrCorrupted = errors.New("metricdb: corrupted data found") // ErrNoLink is returned when the metric to put has no link. ErrNoLink = errors.New("metricdb: no link") // ErrNoStorage is returned when no storage is able to serve, which // indicates that given stamp or stamp range may be invalid. ErrNoStorage = errors.New("metricdb: no storage") )
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.