catena

package module
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2015 License: BSD-3-Clause Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

catena Build Status GoDoc BSD License

n. A closely linked series.

Catena is a storage engine for time series data.

Disclaimer

Catena is just a prototype at the moment. It's not ready for you to use.

License

BSD (see LICENSE)

Documentation

Overview

Package catena provides a storage engine for time series data.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrmetriclistValueExists   = errors.New("catena (metriclist): value exists")
	ErrmetriclistValueNotFound = errors.New("catena (metriclist): value does not exist")
)
View Source
var (
	ErrsourcelistValueExists   = errors.New("catena (sourcelist): value exists")
	ErrsourcelistValueNotFound = errors.New("catena (sourcelist): value does not exist")
)
View Source
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

func NewDB(baseDir string) (*DB, error)

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 OpenDB

func OpenDB(baseDir string) (*DB, error)

OpenDB opens a DB located in baseDir.

func (*DB) InsertRows

func (db *DB) InsertRows(rows Rows) error

InsertRows inserts rows into the database.

func (*DB) Metrics

func (db *DB) Metrics(source string, start, end int64) []string

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.

func (*DB) Sources

func (db *DB) Sources(start, end int64) []string

Sources returns a list of sources present during the given interval.

type Point

type Point struct {
	Timestamp int64   `json:"timestamp"`
	Value     float64 `json:"value"`
}

Point represents an observation at a specific timestamp

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.

type Row

type Row struct {
	Source    string  `json:"source"`
	Metric    string  `json:"metric"`
	Timestamp int64   `json:"timestamp"`
	Value     float64 `json:"value"`
}

type Rows

type Rows []Row

type Series

type Series struct {
	// First timestamp
	Start int64 `json:"start"`

	// Last timestamp
	End int64 `json:"end"`

	Source string `json:"source"`
	Metric string `json:"metric"`

	Points []Point `json:"points"`
}

A Series is an ordered set of points for a source and metric over a range of time.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL