api

package
v1.0.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResultTypePhaseCountFormat = "%s-phase-count"
)
View Source
const (
	ResultTypeResourceOperationCountFormat = "%s-%s-count"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration

type Duration time.Duration

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

type InputConfig

type InputConfig struct {

	// StartTime when set, represents the beginning of the metric time range
	// This defaults to EndTime - Duration when duration is set.
	StartTime *time.Time `json:"startTime,omitempty"`
	// EndTime when set, represents end of the metric time range
	// This defaults to the current time
	EndTime *time.Time `json:"endTime,omitempty"`
	// Duration represents how long to go back from EndTime when creating the metric time range
	// This is mutually exclusive with the StartTime value. Only one of these
	// two values can be set.
	Duration *Duration `json:"duration,omitempty"`

	PrometheusURL         string `json:"prometheusURL"`
	PrometheusUserName    string `json:"prometheusUserName"`
	PrometheusPassword    string `json:"prometheusPassword"`
	PrometheusBearerToken string `json:"prometheusBearerToken"`
	PrometheusVerifyTLS   bool   `json:"prometheusVerifyTLS"`

	// PrometheusScrapeInterval must be correct or the audit tool's results
	// will be inaccurate. Defaults to 30s.
	PrometheusScrapeInterval time.Duration `json:"prometheusScrapeInterval,omitempty"`

	ThresholdExpectations map[ResultType]InputThreshold `json:"thresholdExpectations,omitempty"`
}

func ReadInputFile

func ReadInputFile(filePath string) (*InputConfig, error)

func (*InputConfig) GetDuration

func (i *InputConfig) GetDuration() time.Duration

type InputThreshold

type InputThreshold struct {
	Value  float64    `json:"value"`
	Metric ResultType `json:"metric,omitempty"`
	Ratio  float64    `json:"ratio,omitempty"`
}

type Result

type Result struct {
	Values map[ResultType]ResultValue
}

func (*Result) DumpToFile

func (r *Result) DumpToFile(filePath string) error

func (*Result) DumpToStdout

func (r *Result) DumpToStdout() error

type ResultType

type ResultType string
const (
	// rest_client_requests_total
	ResultTypePatchVMICount   ResultType = "PATCH-virtualmachineinstances-count"
	ResultTypeUpdateVMICount  ResultType = "UPDATE-virtualmachineinstances-count"
	ResultTypeCreatePodsCount ResultType = "CREATE-pods-count"

	// kubevirt_vmi_phase_transition_time_from_creation_seconds_bucket
	ResultTypeVMICreationToRunningP99   ResultType = "vmiCreationToRunningSecondsP99"
	ResultTypeVMICreationToRunningP95   ResultType = "vmiCreationToRunningSecondsP95"
	ResultTypeVMICreationToRunningP50   ResultType = "vmiCreationToRunningSecondsP50"
	ResultTypeVMIDeletionToSucceededP99 ResultType = "vmiDeletionToSucceededSecondsP99"
	ResultTypeVMIDeletionToSucceededP95 ResultType = "vmiDeletionToSucceededSecondsP95"
	ResultTypeVMIDeletionToSucceededP50 ResultType = "vmiDeletionToSucceededSecondsP50"
	ResultTypeVMIDeletionToFailedP99    ResultType = "vmiDeletionToFailedSecondsP99"
	ResultTypeVMIDeletionToFailedP95    ResultType = "vmiDeletionToFailedSecondsP95"
	ResultTypeVMIDeletionToFailedP50    ResultType = "vmiDeletionToFailedSecondsP50"
)

type ResultValue

type ResultValue struct {
	Value           float64          `json:"value"`
	ThresholdResult *ThresholdResult `json:"thresholdResult,omitempty"`
}

type ThresholdResult

type ThresholdResult struct {
	ThresholdValue    float64    `json:"thresholdValue"`
	ThresholdMetric   ResultType `json:"thresholdMetric,omitempty"`
	ThresholdRatio    float64    `json:"thresholdRatio,omitempty"`
	ThresholdExceeded bool       `json:"thresholdExceeded"`
}

Jump to

Keyboard shortcuts

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