timeseries

package
v0.0.0-...-11fc026 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Metric  api.TaggedMetric
	Code    ErrorCode
	Message string
}

func (Error) Error

func (err Error) Error() string

type ErrorCode

type ErrorCode int
const (
	FetchTimeoutError  ErrorCode = iota + 1 // FetchTimeoutError indicates a timeout happened
	FetchIOError                            // FetchIOError indicates an IO error occurred
	InvalidSeriesError                      // InvalidSeriesError indicates the requested series was ill-formed
	LimitError                              // LimitError indicates a resource limit was reached
	Unsupported                             // Unsupported indicates an operation was attempted which is not supported
)

type FetchError

type FetchError struct {
	Message string
	Code    int
}

FetchError can return a custom error code

func (FetchError) Error

func (e FetchError) Error() string

Error returns the message associated with the FetchError.

func (FetchError) ErrorCode

func (e FetchError) ErrorCode() int

ErrorCode returns the error code of the fetch error.

type FetchMultipleRequest

type FetchMultipleRequest struct {
	Metrics []api.TaggedMetric
	RequestDetails
}

func (FetchMultipleRequest) ToSingle

func (r FetchMultipleRequest) ToSingle() []FetchRequest

ToSingle very simply decompose the FetchMultipleTimeseriesRequest into single fetch requests (for now).

type FetchRequest

type FetchRequest struct {
	Metric api.TaggedMetric // metric to fetch.
	RequestDetails
}

type RequestDetails

type RequestDetails struct {
	SampleMethod SampleMethod    // up/downsampling behavior.
	Timerange    api.Timerange   // time range to fetch data from.
	Ctx          context.Context // context includes timeout details
	Profiler     *inspect.Profiler
}

type SampleMethod

type SampleMethod int

SampleMethod determines how the given time series should be sampled.

const (
	// SampleMax chooses the maximum value.
	SampleMax SampleMethod = iota + 1
	// SampleMin chooses the minimum value.
	SampleMin
	// SampleMean chooses the average value.
	SampleMean
)

func (SampleMethod) String

func (sm SampleMethod) String() string

type SeriesType

type SeriesType string

SeriesType is a different aspect of data. For example, Blueflood may stores (min / max / average / count) during rollups, and these data are exposed via columns

type StorageAPI

type StorageAPI interface {
	ChooseResolution(requested api.Timerange, lowerBound time.Duration) (time.Duration, error)
	FetchSingleTimeseries(request FetchRequest) (api.Timeseries, error)
	FetchMultipleTimeseries(request FetchMultipleRequest) (api.SeriesList, error)
	// CheckHealthy checks if this StorageAPI is healthy, returning a possible error
	CheckHealthy() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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