toytsdb

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compressor

type Compressor interface {
	Write(points []*DataPoint) error
	Close() error
}

type DataPoint

type DataPoint struct {
	// The actual value, This field must be set
	Value float64
	// Unix timestamp
	Timestamp int64
}

DataPoint represents a data point , the smallest unit of time seies data

type DeCompressor

type DeCompressor interface {
	Read(dst *DataPoint) error
	Close() error
}

type Label

type Label struct {
	Name  string
	Value string
}

type Logger

type Logger interface {
	Printf(format string, v ...interface{})
}

type Option

type Option func(*storage)

Option is an optional setting for NewStorage

func WithDataPath

func WithDataPath(dataPath string) Option

func WithLogger

func WithLogger(logger Logger) Option

func WithPartitionDuration

func WithPartitionDuration(duration time.Duration) Option

func WithTimestampPrecision

func WithTimestampPrecision(precision time.Duration) Option

type Reader

type Reader interface {
	Select(metrics string, labels []Label, start, end int64) (points []*DataPoint, err error)
}

Reader provides reading access of time serial data

type Row

type Row struct {
	// the uniq name of metrics
	Metrics string
	// An Optional key-value properties of futhres detailed identification
	Labels []Label

	DataPoint
}

type Storage

type Storage interface {
	Reader
	InsertRows(rows []Row) error
	Close() error
}

Storage provides goroutines safe capabilities of inserting into and retrieval from the time serias

func NewStorage

func NewStorage(opts ...Option) (Storage, error)

type TimestampPrecision

type TimestampPrecision string

TimestampPrecision represents precision of timestamp

const (
	Nanoseconds  TimestampPrecision = "ns"
	Microseconds TimestampPrecision = "us"
	Milliseconds TimestampPrecision = "ms"
	Seconds      TimestampPrecision = "s"
)

type Wal

type Wal interface {
	// contains filtered or unexported methods
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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