controller

package
v0.0.0-...-18ff986 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EngineContext = "context"
	WorkFlowName  = "workflow_name"
)

EngineLabelKey is key for ChaosEngineLabel

Functions

func Exporter

func Exporter(clientSet clients.ClientSets, wq workqueue.RateLimitingInterface)

Exporter continuously collects the chaos metrics for a given chaosengine

Types

type AWSConfig

type AWSConfig struct {
	Namespace   string
	ClusterName string
	Service     string
}

AWSConfig contains aws configuration details

type ChaosResultDetails

type ChaosResultDetails struct {
	Name                   string
	UID                    clientTypes.UID
	Namespace              string
	AppKind                string
	AppNs                  string
	AppLabel               string
	PassedExperiments      float64
	FailedExperiments      float64
	AwaitedExperiments     float64
	ProbeSuccessPercentage float64
	StartTime              float64
	EndTime                float64
	InjectionTime          int64
	TotalDuration          float64
	ChaosEngineName        string
	ChaosEngineContext     string
	Verdict                string
	WorkflowName           string
	FaultName              string
}

ChaosResultDetails contains chaosresult details

type GaugeMetrics

type GaugeMetrics struct {
	ResultPassedExperiments                  *prometheus.GaugeVec
	ResultFailedExperiments                  *prometheus.GaugeVec
	ResultAwaitedExperiments                 *prometheus.GaugeVec
	ResultProbeSuccessPercentage             *prometheus.GaugeVec
	ResultVerdict                            *prometheus.GaugeVec
	ExperimentStartTime                      *prometheus.GaugeVec
	ExperimentEndTime                        *prometheus.GaugeVec
	ExperimentTotalDuration                  *prometheus.GaugeVec
	ExperimentChaosInjectedTime              *prometheus.GaugeVec
	NamespaceScopedTotalPassedExperiments    *prometheus.GaugeVec
	NamespaceScopedTotalFailedExperiments    *prometheus.GaugeVec
	NamespaceScopedTotalAwaitedExperiments   *prometheus.GaugeVec
	NamespaceScopedExperimentsInstalledCount *prometheus.GaugeVec
	NamespaceScopedExperimentsRunCount       *prometheus.GaugeVec
	ClusterScopedTotalPassedExperiments      *prometheus.GaugeVec
	ClusterScopedTotalFailedExperiments      *prometheus.GaugeVec
	ClusterScopedTotalAwaitedExperiments     *prometheus.GaugeVec
	ClusterScopedExperimentsInstalledCount   *prometheus.GaugeVec
	ClusterScopedExperimentsRunCount         *prometheus.GaugeVec
}

GaugeMetrics contains all the metrics definition

func (*GaugeMetrics) InitializeGaugeMetrics

func (gaugeMetrics *GaugeMetrics) InitializeGaugeMetrics() *GaugeMetrics

InitializeGaugeMetrics defines schema of all the metrics

func (*GaugeMetrics) RegisterFixedMetrics

func (gaugeMetrics *GaugeMetrics) RegisterFixedMetrics()

RegisterFixedMetrics register the prometheus metrics

type MetricesCollecter

type MetricesCollecter struct {
	ResultCollector ResultCollector
	GaugeMetrics    GaugeMetrics
}

func (*MetricesCollecter) GetLitmusChaosMetrics

func (m *MetricesCollecter) GetLitmusChaosMetrics(clients clients.ClientSets, overallChaosResults *[]*litmuschaosv1alpha1.ChaosResult, monitoringEnabled *MonitoringEnabled) (*time.Duration, error)

GetLitmusChaosMetrics derive and send the chaos metrics

type MonitoringEnabled

type MonitoringEnabled struct {
	IsChaosResultsAvailable bool
	IsChaosEnginesAvailable bool
}

MonitoringEnabled contains existence/availability of chaosEngines and chaosResults

type NamespacedScopeMetrics

type NamespacedScopeMetrics struct {
	PassedExperiments         float64
	FailedExperiments         float64
	AwaitedExperiments        float64
	ExperimentRunCount        float64
	ExperimentsInstalledCount float64
}

NamespacedScopeMetrics contains metrics for the chaos namespace

type ResultCollector

type ResultCollector interface {
	GetResultList(clients clients.ClientSets, chaosNamespace string, monitoringEnabled *MonitoringEnabled) ([]*v1alpha1.ChaosResult, error)
	GetExperimentMetricsFromResult(chaosResult *litmuschaosv1alpha1.ChaosResult, clients clients.ClientSets) (bool, error)
	SetResultDetails()
	GetResultDetails() ChaosResultDetails
}

ResultCollector interface for the both functions GetResultList and getExperimentMetricsFromResult

type ResultData

type ResultData struct {
	ChaosEngineContext     string
	WorkFlowName           string
	AppKind                string
	AppNs                  string
	AppLabel               string
	Verdict                string
	Timer                  time.Time
	VerdictReset           bool
	ProbeSuccessPercentage float64
	FaultName              string
}

ResultData contains attributes to store metrics parameters which can be used while handling chaosresult deletion

type ResultDetails

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

func (*ResultDetails) GetExperimentMetricsFromResult

func (r *ResultDetails) GetExperimentMetricsFromResult(chaosResult *litmuschaosv1alpha1.ChaosResult, clients clients.ClientSets) (bool, error)

GetExperimentMetricsFromResult derive all the metrics data from the chaosresult and set into resultDetails struct

func (*ResultDetails) GetResultDetails

func (r *ResultDetails) GetResultDetails() ChaosResultDetails

func (*ResultDetails) GetResultList

func (r *ResultDetails) GetResultList(clients clients.ClientSets, chaosNamespace string, monitoringEnabled *MonitoringEnabled) ([]*v1alpha1.ChaosResult, error)

GetResultList return the result list correspond to the monitoring enabled chaosengine

func (*ResultDetails) SetResultDetails

func (r *ResultDetails) SetResultDetails()

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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