Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { Query(ctx context.Context, query string, ts time.Time, opts ...apiv1.Option) (model.Value, apiv1.Warnings, error) QueryRange(ctx context.Context, query string, r apiv1.Range, opts ...apiv1.Option) (model.Value, apiv1.Warnings, error) }
API is a subset of Prometheus API interface. https://github.com/prometheus/client_golang/blob/release-1.14/api/prometheus/v1/api.go#L221-L266 This subset allows us to implement in our tests only the functions we use, while allowing compatibility with Prometheus API interface.
type Configuration ¶
type Helper ¶
type Helper struct {
// contains filtered or unexported fields
}
func NewHelper ¶
NewHelper creates a helper with the standard Prometheus client and API inside it, encapsulating all Prometheus dependencies.
func (*Helper) Matrix ¶
Matrix returns the matrix of metrics of a query in the given duration. It ensures that the returned matrix has atleast one row.
type Query ¶
type Query struct { // The description for the query. Description string `validate:"notempty"` // The PromQL query to be run. Query string `validate:"notempty"` // The value over which the performance monitor will fire an alert // to the coordinator's feedback loop. Threshold float64 `validate:"range:[0,]"` // The minimum amount of time (in seconds) that needs to have passed // since the start of the monitoring process before the query can be run. MinIntervalSec int `validate:"range:[0,]"` // The value indicating whether or not to fire an alert. Alert bool }
Query contains the needed information to perform a query.
Click to show internal directories.
Click to hide internal directories.