Documentation ¶
Index ¶
- func AllowPrometheusSync(logf logging.FormatLogger)
- func PromAPI() (v1.API, error)
- func RunQuery(ctx context.Context, logf logging.FormatLogger, promAPI v1.API, query string) (float64, error)
- func RunQueryRange(ctx context.Context, logf logging.FormatLogger, promAPI v1.API, query string, ...) (float64, error)
- func VectorValue(val model.Value) (float64, error)
- type PromProxy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowPrometheusSync ¶
func AllowPrometheusSync(logf logging.FormatLogger)
AllowPrometheusSync sleeps for sometime to allow prometheus time to scrape the metrics.
func RunQuery ¶
func RunQuery(ctx context.Context, logf logging.FormatLogger, promAPI v1.API, query string) (float64, error)
RunQuery runs a prometheus query and returns the metric value
Types ¶
type PromProxy ¶
type PromProxy struct { Namespace string // contains filtered or unexported fields }
PromProxy defines a proxy to the prometheus server
func (*PromProxy) Setup ¶
func (p *PromProxy) Setup(ctx context.Context, kubeClientset kubernetes.Interface, logf logging.FormatLogger)
Setup performs a port forwarding for app prometheus-test in given namespace
func (*PromProxy) Teardown ¶
func (p *PromProxy) Teardown(logf logging.FormatLogger)
Teardown will kill the port forwarding process if running.
Click to show internal directories.
Click to hide internal directories.