Documentation ¶
Overview ¶
Package metricdb handles the storage for metrics.
Design ¶
The db file name is metric and its key-value design in leveldb is:
Key: <Name>:<Stamp> Value: <Value>:<Score>:<Average>
For less disk usage:
1. Metric stamps will be converted to 36-hex strings before they are put to db.
2. Metric stamps will minus a "stamp horizon" before they are converted to string.
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") // ErrStampTooSmall is returned when stamp is smaller than horizon. ErrStampTooSmall = errors.New("metricdb: stamp is too small") )
Functions ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB handles metrics storage.
Click to show internal directories.
Click to hide internal directories.