libmonitoring

package
v1.3.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAlertExists

func CheckAlertExists(virtClient kubecli.KubevirtClient, alertName string) bool

func DoPrometheusHTTPRequest

func DoPrometheusHTTPRequest(cli kubecli.KubevirtClient, endpoint string) []byte

func GetAlerts

func GetAlerts(cli kubecli.KubevirtClient) ([]prometheusv1.Alert, error)

func GetKubevirtVMMetrics

func GetKubevirtVMMetrics(pod *k8sv1.Pod, ip string) string

func GetMetricValueWithLabels

func GetMetricValueWithLabels(cli kubecli.KubevirtClient, query string, labels map[string]string) (float64, error)

func KillPortForwardCommand

func KillPortForwardCommand(portForwardCmd *exec.Cmd) error

func PrepareMetricsURL

func PrepareMetricsURL(ip string, port int) string

func ReduceAlertPendingTime

func ReduceAlertPendingTime(virtClient kubecli.KubevirtClient)

func VerifyAlertExist

func VerifyAlertExist(virtClient kubecli.KubevirtClient, alertName string)

func VerifyAlertExistWithCustomTime

func VerifyAlertExistWithCustomTime(virtClient kubecli.KubevirtClient, alertName string, timeout time.Duration)

func WaitForMetricValue

func WaitForMetricValue(client kubecli.KubevirtClient, metric string, expectedValue float64)

func WaitForMetricValueWithLabels

func WaitForMetricValueWithLabels(client kubecli.KubevirtClient, metric string, expectedValue float64, labels map[string]string, offset int)

func WaitForPortForwardCmd

func WaitForPortForwardCmd(stdout io.ReadCloser, src, dst int)

func WaitUntilAlertDoesNotExist

func WaitUntilAlertDoesNotExist(virtClient kubecli.KubevirtClient, alertNames ...string)

func WaitUntilAlertDoesNotExistWithCustomTime

func WaitUntilAlertDoesNotExistWithCustomTime(virtClient kubecli.KubevirtClient, timeout time.Duration, alertNames ...string)

Types

type AlertRequestResult

type AlertRequestResult struct {
	Alerts prometheusv1.AlertsResult `json:"data"`
	Status string                    `json:"status"`
}

type MetricMatcher

type MetricMatcher struct {
	Metric operatormetrics.Metric
	Labels map[string]string
}

func (*MetricMatcher) FailureMessage

func (matcher *MetricMatcher) FailureMessage(actual interface{}) (message string)

func (*MetricMatcher) Match

func (matcher *MetricMatcher) Match(actual interface{}) (success bool, err error)

func (*MetricMatcher) NegatedFailureMessage

func (matcher *MetricMatcher) NegatedFailureMessage(actual interface{}) (message string)

type QueryRequestResult

type QueryRequestResult struct {
	Data   promData `json:"data"`
	Status string   `json:"status"`
}

func QueryRange

func QueryRange(cli kubecli.KubevirtClient, query string, start time.Time, end time.Time, step time.Duration) (*QueryRequestResult, error)

type Scaling

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

func NewScaling

func NewScaling(virtClient kubecli.KubevirtClient, deployments []string) *Scaling

func (*Scaling) BackupScale

func (s *Scaling) BackupScale(operatorName string)

func (*Scaling) RestoreAllScales

func (s *Scaling) RestoreAllScales()

func (*Scaling) RestoreScale

func (s *Scaling) RestoreScale(operatorName string)

func (*Scaling) UpdateScale

func (s *Scaling) UpdateScale(operatorName string, replicas int32)

Jump to

Keyboard shortcuts

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