mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-25 11:50:13 +01:00
b099d84271
* Initial rules evaluation support. Rules are now store alerts state in private field `alerts`. Every evaluation updates the alerts and state. Every unique metric received from datastore represents a unique alert, uniqueness is guaranteed by hashing ordered labelset. * merge with master * cleanup * support endAt parameter as 3*evaluationInterval for active alerts * make golint happy
25 lines
528 B
Go
25 lines
528 B
Go
package datasource
|
|
|
|
import "context"
|
|
|
|
// Querier interface wraps Query method which
|
|
// executes given query and returns list of Metrics
|
|
// as result
|
|
type Querier interface {
|
|
Query(ctx context.Context, query string) ([]Metric, error)
|
|
}
|
|
|
|
// Metric is the basic entity which should be return by datasource
|
|
// It represents single data point with full list of labels
|
|
type Metric struct {
|
|
Labels []Label
|
|
Timestamp int64
|
|
Value float64
|
|
}
|
|
|
|
// Label represents metric's label
|
|
type Label struct {
|
|
Name string
|
|
Value string
|
|
}
|