storage

package
v0.14.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetQueryTerminatorTagName

func GetQueryTerminatorTagName(query string) []byte

GetQueryTerminatorTagName will return the name for the terminator matcher in the given pattern. This is useful for filtering out any additional results.

func TranslateQueryToMatchersWithTerminator added in v0.8.0

func TranslateQueryToMatchersWithTerminator(
	query string,
) (models.Matchers, error)

TranslateQueryToMatchersWithTerminator converts a graphite query to tag matcher pairs, and adds a terminator matcher to the end.

Types

type DataOptions

type DataOptions struct {
	// Timeout determines a custom timeout for the context. If set to 0, uses
	// the default timeout.
	Timeout time.Duration
	// Limit is the limit for number of datapoints to retrieve.
	Limit int
}

DataOptions provide data context.

type FetchOptions

type FetchOptions struct {
	// StartTime is the start time for the fetch.
	StartTime time.Time
	// EndTime is the end time for the fetch.
	EndTime time.Time
	// DataOptions are the options for the fetch.
	DataOptions
}

FetchOptions provides context to a fetch expression.

type FetchResult

type FetchResult struct {
	// SeriesList is the aggregated list of results across all underlying storage
	// calls.
	SeriesList []*ts.Series
	// Metadata contains any additional metadata indicating information about
	// series execution.
	Metadata block.ResultMetadata
}

FetchResult provides a fetch result and meta information.

func NewFetchResult

func NewFetchResult(
	ctx context.Context,
	seriesList []*ts.Series,
	resultMeta block.ResultMetadata,
) *FetchResult

NewFetchResult is a convenience method for creating a FetchResult.

func (*FetchResult) Close

func (fr *FetchResult) Close() error

Close will return the fetch result to the pool.

func (*FetchResult) Reset

func (fr *FetchResult) Reset()

Reset will wipe out existing fetch result data.

type Storage

type Storage interface {
	// FetchByQuery fetches timeseries data based on a query.
	FetchByQuery(
		ctx context.Context, query string, opts FetchOptions,
	) (*FetchResult, error)
}

Storage provides an interface for retrieving timeseries values or names based upon a query or path.

func NewM3WrappedStorage

func NewM3WrappedStorage(
	m3storage storage.Storage,
	enforcer cost.ChainedEnforcer,
	instrumentOpts instrument.Options,
) Storage

NewM3WrappedStorage creates a graphite storage wrapper around an m3query storage instance.

Jump to

Keyboard shortcuts

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