Documentation
¶
Overview ¶
Package catena provides a storage engine for time series data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrmetriclistValueExists = errors.New("catena (metriclist): value exists") ErrmetriclistValueNotFound = errors.New("catena (metriclist): value does not exist") )
var ( ErrsourcelistValueExists = errors.New("catena (sourcelist): value exists") ErrsourcelistValueNotFound = errors.New("catena (sourcelist): value does not exist") )
var ( ErrpointListValueExists = errors.New("catena (pointList): value exists") ErrpointListValueNotFound = errors.New("catena (pointList): value does not exist") )
Functions ¶
func Newmetriclist ¶
func Newmetriclist() *metriclist
NewList returns a lock-free ordered list with values of type *memoryMetric.
func NewpointList ¶
func NewpointList() *pointList
NewList returns a lock-free ordered list with values of type Point.
func Newsourcelist ¶
func Newsourcelist() *sourcelist
NewList returns a lock-free ordered list with values of type *memorySource.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is a handle to a catena database.
func NewDB ¶
NewDB creates a new DB located in baseDir. If baseDir does not exist it will be created. An error is returned if baseDir is not empty.
func (*DB) InsertRows ¶
InsertRows inserts rows into the database.
func (*DB) Metrics ¶
Metrics returns a list of metrics present for the given source during the given interval.
func (*DB) Query ¶
func (db *DB) Query(descs []QueryDesc) QueryResponse
Query fetches series matching the QueryDescs and returns a QueryResponse.
type QueryDesc ¶
type QueryDesc struct {
Source string `json:"source"`
Metric string `json:"metric"`
Start int64 `json:"start"`
End int64 `json:"end"`
}
A QueryDesc is a description of a query. It specifies a source, metric, start, and end timestamps.
type QueryResponse ¶
type QueryResponse struct {
Series []Series `json:"series"`
}
A QueryResponse is returned after querying the DB with a QueryDesc.
