catena

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2015 License: BSD-3-Clause Imports: 14 Imported by: 0

README

catena Build Status GoDoc BSD License

n. A closely linked series.

Catena is a storage engine for time series data.

Documentation

Extensive documentation is not available yet, but there are a few resources you can use to learn more:

  1. Original blog post introduction Catena: http://misfra.me/state-of-the-state-part-iii
  2. Time series storage slide deck: https://speakerdeck.com/preetamjinka/time-series-storage

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 time series storage engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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, partitionSize, maxPartitions int) (*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, partitionSize, maxPartitions int) (*DB, error)

OpenDB opens a DB located in baseDir.

func (*DB) Close added in v0.1.0

func (db *DB) Close() error

Close closes the DB and releases any internal state. Close will block if there are active iterators.

func (*DB) InsertRows

func (db *DB) InsertRows(rows []Row) error

InsertRows inserts the given rows into the database.

func (*DB) Metrics

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

Metrics returns a slice of metrics that are present within the given time range for the given source.

func (*DB) NewIterator added in v0.1.0

func (db *DB) NewIterator(source, metric string) (*Iterator, error)

NewIterator creates a new Iterator for the given source and metric.

func (*DB) Sources

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

Sources returns a slice of sources that are present within the given time range.

type Iterator added in v0.1.0

type Iterator struct {
	partition.Iterator
	// contains filtered or unexported fields
}

An Iterator is a cursor over an array of points for a source and metric.

func (*Iterator) Close added in v0.1.0

func (i *Iterator) Close()

Close closes the iterator. Iterators MUST be closed to unblock the compactor!

func (*Iterator) Next added in v0.1.0

func (i *Iterator) Next() error

Next advances i to the next available point.

func (*Iterator) Reset added in v0.1.0

func (i *Iterator) Reset() error

Reset moves i to the first available timestamp.

func (*Iterator) Seek added in v0.1.0

func (i *Iterator) Seek(timestamp int64) error

Seek moves the iterator to the first timestamp greater than or equal to timestamp.

type Point

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

A Point is a single observation of a time series metric. It has a timestamp and a value.

type Row

type Row struct {
	Source string `json:"source"`
	Metric string `json:"metric"`
	Point
}

A Row is a Point with Source and Metric fields.

Directories

Path Synopsis
Package wal provides a write-ahead log.
Package wal provides a write-ahead log.

Jump to

Keyboard shortcuts

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