chronix

package
v0.0.0-...-98aa545 Latest Latest
Warning

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

Go to latest
Published: May 17, 2018 License: Apache-2.0 Imports: 19 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelableTransport

type CancelableTransport interface {
	http.RoundTripper
	CancelRequest(req *http.Request)
}

CancelableTransport is like net.Transport but provides per-request cancelation functionality.

var DefaultTransport CancelableTransport = &http.Transport{
	Proxy: http.ProxyFromEnvironment,
	Dial: (&net.Dialer{
		Timeout:   30 * time.Second,
		KeepAlive: 30 * time.Second,
	}).Dial,
	TLSHandshakeTimeout: 10 * time.Second,
}

DefaultTransport is used by the solrClient when no explicit transport is provided.

type Client

type Client interface {
	Store(ts []*TimeSeries, commit bool, commitWithin time.Duration) error
	// TODO: Return a more interpreted query result on the Chronix level.
	Query(q, fq, fl string) ([]byte, error)
}

Client is a client that allows storing time series in Chronix.

func New

func New(s StorageClient) Client

New creates a new Chronix client. The client does not create statistics for the individual data chunks in the storage.

func NewWithStatistics

func NewWithStatistics(s StorageClient) Client

creates a new Chronix client. The client does create statistics for the individual data chunks in the storage.

type Point

type Point struct {
	Timestamp int64
	Value     float64
}

A Point models a Chronix time series sample.

type StorageClient

type StorageClient interface {
	Update(data []map[string]interface{}, commit bool, commitWithin time.Duration) error
	// TODO: Return a more interpreted result on the Solr level.
	Query(q, fq, fl string) ([]byte, error)

	NeedPostfixOnDynamicField() bool
}

A StorageClient allows updating documents in Solr.

func NewElasticStorage

func NewElasticStorage(url *string, withIndex *bool, deleteIfExists *bool, sniffElasticNodes *bool) StorageClient

NewElasticStorage creates a new Elastic client.

func NewElasticTestStorage

func NewElasticTestStorage(url *string) StorageClient

Only for test purposes

func NewSolrStorage

func NewSolrStorage(url *url.URL, transport CancelableTransport) StorageClient

NewSolrStorage creates a new Solr client.

type TimeSeries

type TimeSeries struct {
	Name       string
	Type       string
	Attributes map[string]string
	Points     []Point
}

A TimeSeries models a Chronix time series chunk.

Directories

Path Synopsis
Package MetricPoint is a generated protocol buffer package.
Package MetricPoint is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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