local

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(dataBase moira.Database) metricSource.MetricSource

Create configures local metric source

func FetchData

func FetchData(database moira.Database, pattern string, from int64, until int64, allowRealTimeAlerting bool) ([]*types.MetricData, []string, error)

FetchData gets values of given pattern metrics from given interval and returns values and all found pattern metrics

Types

type ErrEvalExpr

type ErrEvalExpr struct {
	// contains filtered or unexported fields
}

ErrEvalExpr used when carbonapi.EvalExpr returns error

func (ErrEvalExpr) Error

func (err ErrEvalExpr) Error() string

Error is implementation of golang error interface for ErrEvalExpr struct

type ErrEvaluateTargetFailedWithPanic

type ErrEvaluateTargetFailedWithPanic struct {
	// contains filtered or unexported fields
}

ErrEvaluateTargetFailedWithPanic used to identify occurred error as a result of recover from panic

func (ErrEvaluateTargetFailedWithPanic) Error

Error is implementation of golang error interface for ErrEvaluateTargetFailedWithPanic struct

type ErrParseExpr

type ErrParseExpr struct {
	// contains filtered or unexported fields
}

ErrParseExpr used when carbonapi.ParseExpr returns error

func (ErrParseExpr) Error

func (err ErrParseExpr) Error() string

Error is implementation of golang error interface for ErrParseExpr struct

type ErrUnknownFunction

type ErrUnknownFunction struct {
	FuncName string
	// contains filtered or unexported fields
}

ErrUnknownFunction used when carbonapi.ParseExpr returns unknown function error

func ErrorUnknownFunction

func ErrorUnknownFunction(err error) ErrUnknownFunction

ErrorUnknownFunction parses internal carbon-api error errUnknownFunction, gets func name and return ErrUnknownFunction error

func (ErrUnknownFunction) Error

func (err ErrUnknownFunction) Error() string

Error is implementation of golang error interface for ErrUnknownFunction struct

type FetchResult

type FetchResult struct {
	MetricsData []*metricSource.MetricData
	Patterns    []string
	Metrics     []string
}

FetchResult is implementation of metric_source.FetchResult interface, which represent fetching result from moira data source in moira format

func CreateEmptyFetchResult

func CreateEmptyFetchResult() *FetchResult

CreateEmptyFetchResult just creates FetchResult with initialized empty fields

func (*FetchResult) GetMetricsData

func (fetchResult *FetchResult) GetMetricsData() []*metricSource.MetricData

GetMetricsData return all metrics data from fetch result

func (*FetchResult) GetPatternMetrics

func (fetchResult *FetchResult) GetPatternMetrics() ([]string, error)

GetPatternMetrics return all metrics which match to evaluated graphite target patterns

func (*FetchResult) GetPatterns

func (fetchResult *FetchResult) GetPatterns() ([]string, error)

GetPatterns return all patterns which contains in evaluated graphite target

type Local

type Local struct {
	// contains filtered or unexported fields
}

Local is implementation of MetricSource interface, which implements fetch metrics method from moira database installation

func (*Local) Fetch

func (local *Local) Fetch(target string, from int64, until int64, allowRealTimeAlerting bool) (metricSource.FetchResult, error)

Fetch is analogue of evaluateTarget method in graphite-web, that gets target metrics value from DB and Evaluate it using carbon-api eval package

func (*Local) IsConfigured

func (local *Local) IsConfigured() (bool, error)

IsConfigured always returns true. It easy to configure local source =)

Jump to

Keyboard shortcuts

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