metrics

package
v0.9.11 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoDataFound = errors.New("no data found")
)

Functions

This section is empty.

Types

type Evaluator added in v0.9.8

type Evaluator interface {
	// InRange checks if the value is expected one.
	InRange(value float64) bool
	String() string
}

Evaluator evaluates the response from the metrics provider.

type Provider

type Provider interface {
	Type() string
	// Evaluate runs the given query against the metrics provider,
	// and then checks if the results are expected or not.
	// Returns the result reason if non-error occurred.
	// The first value "expected" must be false if err isn't nil.
	Evaluate(ctx context.Context, query string, queryRange QueryRange, evaluator Evaluator) (expected bool, reason string, err error)
}

Provider represents a client for metrics provider which provides metrics for analysis.

type QueryRange added in v0.9.8

type QueryRange struct {
	// Required: Start of the queried time period
	From time.Time
	// End of the queried time period. Defaults to the current time.
	To time.Time
}

QueryRange represents a sliced time range.

func (*QueryRange) Validate added in v0.9.8

func (q *QueryRange) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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