libtsdb

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2018 License: MIT Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Databases

func Databases() []string

func RegisterMeta

func RegisterMeta(db string, meta Meta)

Types

type HttpClient

type HttpClient interface {
	SetHttpClient(client *http.Client)
	AllowInsecure()
	HttpStatusCode() int
}

type HttpTrace

type HttpTrace struct {
	// response
	StatusCode   int
	Error        bool
	ErrorMessage string

	Points int

	// size
	PayloadSize int
	RawSize     int
	RawMetaSize int

	// time
	Start int64
	End   int64
	// net/http/httptrace
	DNSStart int64
	DNSDone  int64
	GetConn  int64
	GotConn  int64
	Reused   bool
	TLSStart int64
	TLSStop  int64
	ReqStart int64
	ReqDone  int64
	ResStart int64
	ResDone  int64
}

func (*HttpTrace) GetCode

func (t *HttpTrace) GetCode() int

func (*HttpTrace) GetEndTime

func (t *HttpTrace) GetEndTime() int64

func (*HttpTrace) GetError

func (t *HttpTrace) GetError() bool

func (*HttpTrace) GetErrorMessage

func (t *HttpTrace) GetErrorMessage() string

func (*HttpTrace) GetPayloadSize

func (t *HttpTrace) GetPayloadSize() int

func (*HttpTrace) GetPoints

func (t *HttpTrace) GetPoints() int

func (*HttpTrace) GetRawMetaSize

func (t *HttpTrace) GetRawMetaSize() int

func (*HttpTrace) GetRawSize

func (t *HttpTrace) GetRawSize() int

func (*HttpTrace) GetStartTime

func (t *HttpTrace) GetStartTime() int64

func (*HttpTrace) Reset

func (t *HttpTrace) Reset()

type HttpWriteClient

type HttpWriteClient interface {
	WriteClient
	HttpClient
}

type Meta

type Meta struct {
	Name          string
	Repo          string
	TimePrecision time.Duration
	SupportTag    bool
	SupportInt    bool
	SupportDouble bool
	// write multiple series in one payload
	SupportBatchSeries bool
	// merge points of same series into more compact format
	SupportBatchPoints bool
}

Meta describes a database's behavior

func GetDatabaseMeta

func GetDatabaseMeta(name string) (Meta, error)

type ReadClient

type ReadClient interface {
	TSDBClient
	CreateDatabase(db string) error
}

TODO: figure out the interface for read request...

type TSDBClient

type TSDBClient interface {
	Meta() Meta
	Close() error
}

TSBClient returns meta of the database including its protocol, data type support

type TcpTrace

type TcpTrace struct {
	// response TODO: we don't wait response cause many of them don't have response
	Code         int // TODO: any code like http status code in tcp ...
	Error        bool
	ErrorMessage string

	Points int

	// size
	PayloadSize int
	RawSize     int
	RawMetaSize int

	// time
	Start int64
	End   int64
}

func (*TcpTrace) GetCode

func (t *TcpTrace) GetCode() int

func (*TcpTrace) GetEndTime

func (t *TcpTrace) GetEndTime() int64

func (*TcpTrace) GetError

func (t *TcpTrace) GetError() bool

func (*TcpTrace) GetErrorMessage

func (t *TcpTrace) GetErrorMessage() string

func (*TcpTrace) GetPayloadSize

func (t *TcpTrace) GetPayloadSize() int

func (*TcpTrace) GetPoints

func (t *TcpTrace) GetPoints() int

func (*TcpTrace) GetRawMetaSize

func (t *TcpTrace) GetRawMetaSize() int

func (*TcpTrace) GetRawSize

func (t *TcpTrace) GetRawSize() int

func (*TcpTrace) GetStartTime

func (t *TcpTrace) GetStartTime() int64

func (*TcpTrace) Reset

func (t *TcpTrace) Reset()

type Trace

type Trace interface {
	// GetError specifies if this result is an error
	GetError() bool
	// GetErrorMessage is empty if Error is false
	GetErrorMessage() string
	// GetCode is response code from server, normally http status code
	GetCode() int
	// GetStartTime is when the request is started
	GetStartTime() int64
	// GetEndTime is when the request is finished, response is drained, error or not
	GetEndTime() int64
	// GetPoints is number of points written in request
	GetPoints() int
	// GetPayloadSize is the size of the payload excluding header etc.
	GetPayloadSize() int
	// GetRawSize is the size in byte for meta and points written without serialization, see libtsdbpb sizer.go
	GetRawSize() int
	// GetRawMetaSize is the size in byte for meta data written without serialization, series name tags etc.
	GetRawMetaSize() int
}

FIXME: trace is copied from xephon-b/pkg/metrics

type TracedClient

type TracedClient interface {
	Trace() Trace
}

type TracedHttpClient

type TracedHttpClient interface {
	TracedClient
	EnableHttpTrace()
	DisableHttpTrace()
	HttpTrace() HttpTrace
}

type TracedTcpClient

type TracedTcpClient interface {
	TracedClient
	TcpTrace() TcpTrace
}

type TracedWriteClient

type TracedWriteClient interface {
	TracedClient
	WriteClient
}

type WriteClient

type WriteClient interface {
	TSDBClient
	WriteIntPoint(*pb.PointIntTagged)
	WriteDoublePoint(*pb.PointDoubleTagged)
	WriteSeriesIntTagged(p *pb.SeriesIntTagged)
	WriteSeriesDoubleTagged(p *pb.SeriesDoubleTagged)
	Flush() error
}

Directories

Path Synopsis
Package client contains client for multiple time series databases, note write and read clients are separated to reduce dependencies in write client, and it's common when using time series database, some clients always write (i.e.
Package client contains client for multiple time series databases, note write and read clients are separated to reduce dependencies in write client, and it's common when using time series database, some clients always write (i.e.
xephonk
Package xephonk only imports xephon-k's client package to register meta
Package xephonk only imports xephon-k's client package to register meta
Package libtsdbpb is a generated protocol buffer package.
Package libtsdbpb is a generated protocol buffer package.
Package storage contains compatible implementation or wrapper around existing tsdb storage engines (written in go), i.e.
Package storage contains compatible implementation or wrapper around existing tsdb storage engines (written in go), i.e.
influxtsm
Package tsm is wrapper around InfluxDB's Time Structure Merge Tree engine
Package tsm is wrapper around InfluxDB's Time Structure Merge Tree engine
promtsdb
Package promtsdb wraps https://github.com/prometheus/tsdb
Package promtsdb wraps https://github.com/prometheus/tsdb
util

Jump to

Keyboard shortcuts

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