metadata

package
v0.0.0-...-33d5a37 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// CustomMetadataFile is the name of the custom metadata file generated for spyglass visualization.
	CustomMetadataFile string = "custom-prow-metadata.json"

	// MetadataFile is the name of the custom metadata file generated for spyglass visualization.
	MetadataFile string = "metadata.json"

	// TestHarnessMetadataFile is name of the test harness metadata file
	TestHarnessMetadataFile string = "test-harness-metadata.json"

	// AddonMetadataFile is created by some addons during execution
	AddonMetadataFile string = "addon-metadata.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddonMetadata

type AddonMetadata struct {
	// Whether the CRD was found. Typically Spyglass seems to have issues displaying non-strings, so
	// this will be written out as a string despite the native JSON boolean type.
	Version string `json:"version,string"`
	ID      string `json:"id,string"`
}

addonMetadata houses metadata to be written out to the additional-metadata.json

func (*AddonMetadata) SetID

func (m *AddonMetadata) SetID(id string)

func (*AddonMetadata) SetVersion

func (m *AddonMetadata) SetVersion(version string)

func (*AddonMetadata) WriteToJSONFile

func (m *AddonMetadata) WriteToJSONFile(outputFilename string) (err error)

WriteToJSON will marshall the addon metadata struct and write it into the given file.

type Metadata

type Metadata struct {
	// Cluster information
	ClusterID            string `json:"cluster-id"`
	ClusterName          string `json:"cluster-name"`
	ClusterVersion       string `json:"cluster-version"`
	Environment          string `json:"environment"`
	Region               string `json:"region"`
	UpgradeVersion       string `json:"upgrade-version,omitempty"`
	UpgradeVersionSource string `json:"upgrade-version-source,omitempty"`

	// Metrics
	TimeToOCMReportingInstalled float64            `json:"time-to-ocm-reporting-installed,string"`
	TimeToClusterReady          float64            `json:"time-to-cluster-ready,string"`
	TimeToUpgradedCluster       float64            `json:"time-to-upgraded-cluster,string"`
	TimeToUpgradedClusterReady  float64            `json:"time-to-upgraded-cluster-ready,string"`
	TimeToCertificateIssued     float64            `json:"time-to-certificate-issued,string"`
	InstallPhasePassRate        float64            `json:"install-phase-pass-rate,string"`
	UpgradePhasePassRate        float64            `json:"upgrade-phase-pass-rate,string"`
	LogMetrics                  map[string]int     `json:"log-metrics"`
	BeforeSuiteMetrics          map[string]int     `json:"before-suite-metrics"`
	RouteLatencies              map[string]float64 `json:"route-latencies"`
	RouteThroughputs            map[string]float64 `json:"route-throughputs"`
	RouteAvailabilities         map[string]float64 `json:"route-availabilities"`

	// Real Time Data
	HealthChecks         map[string][]string `json:"healthchecks"`
	HealthCheckIteration float64             `json:"healthcheckIteration"`
	Status               string              `json:"status"`

	// Internal variables
	ReportDir string `json:"-"`
}

Metadata houses the metadata that will be written to the report directory after

var Instance *Metadata

Instance is the global metadata instance

func (*Metadata) ClearHealthcheckValue

func (m *Metadata) ClearHealthcheckValue(key string)

ClearHealthcheckValue removes a pending healthcheck

func (*Metadata) IncrementBeforeSuiteMetric

func (m *Metadata) IncrementBeforeSuiteMetric(metric string, value int)

IncrementBeforeSuiteMetric adds a supplied number to a before suite metric or sets the metric to the value if it doesn't exist already

func (*Metadata) IncrementHealthcheckIteration

func (m *Metadata) IncrementHealthcheckIteration()

IncrementHealthcheckIteration increments the healthcheck counter

func (*Metadata) IncrementLogMetric

func (m *Metadata) IncrementLogMetric(metric string, value int)

IncrementLogMetric adds a supplied number to a log metric or sets the metric to the value if it doesn't exist already

func (*Metadata) ResetBeforeSuiteMetrics

func (m *Metadata) ResetBeforeSuiteMetrics()

ResetBeforeSuiteMetrics zeroes out old results to be used before a new run.

func (*Metadata) ResetLogMetrics

func (m *Metadata) ResetLogMetrics()

ResetLogMetrics zeroes out old results to be used before a new run.

func (*Metadata) SetClusterID

func (m *Metadata) SetClusterID(id string)

SetClusterID sets the cluster id

func (*Metadata) SetClusterName

func (m *Metadata) SetClusterName(name string)

SetClusterName sets the cluster name

func (*Metadata) SetClusterVersion

func (m *Metadata) SetClusterVersion(version string)

SetClusterVersion sets the cluster version

func (*Metadata) SetEnvironment

func (m *Metadata) SetEnvironment(env string)

SetEnvironment sets the cluster environment

func (*Metadata) SetHealthcheckValue

func (m *Metadata) SetHealthcheckValue(key string, value []string)

SetHealthcheckValue sets an arbitrary string value to a healthcheck

func (*Metadata) SetPassRate

func (m *Metadata) SetPassRate(currentPhase string, passRate float64)

SetPassRate sets the passrate metadata metric for the given phase

func (*Metadata) SetRegion

func (m *Metadata) SetRegion(region string)

SetRegion sets the cluster environment

func (*Metadata) SetReportDir

func (m *Metadata) SetReportDir(reportDir string)

SetReportDir sets the report dir for the metadata.

func (*Metadata) SetRouteAvailability

func (m *Metadata) SetRouteAvailability(route string, availability float64)

SetRouteAvailability sets the availability for the given route (ratio of successful requests)

func (*Metadata) SetRouteLatency

func (m *Metadata) SetRouteLatency(route string, latency float64)

SetRouteLatency sets the mean latency for the given route (measured in milliseconds)

func (*Metadata) SetRouteThroughput

func (m *Metadata) SetRouteThroughput(route string, throughput float64)

SetRouteThroughput sets the throughput for the given route (rate of successful requests per second)

func (*Metadata) SetStatus

func (m *Metadata) SetStatus(status string)

SetStatus stores the status of an osde2e cluster

func (*Metadata) SetTimeToCertificateIssued

func (m *Metadata) SetTimeToCertificateIssued(timeToCertificateIssued float64)

SetTimeToCertificateIssued sets the time it took for a certificate to be issued to the cluster

func (*Metadata) SetTimeToClusterReady

func (m *Metadata) SetTimeToClusterReady(timeToClusterReady float64)

SetTimeToClusterReady sets the time it took for the cluster to appear healthy on install

func (*Metadata) SetTimeToOCMReportingInstalled

func (m *Metadata) SetTimeToOCMReportingInstalled(timeToOCMReportingInstalled float64)

SetTimeToOCMReportingInstalled sets the time it took for OCM to report a cluster provisioned

func (*Metadata) SetTimeToUpgradedCluster

func (m *Metadata) SetTimeToUpgradedCluster(timeToUpgradedCluster float64)

SetTimeToUpgradedCluster sets the time it took for the cluster to install an upgrade

func (*Metadata) SetTimeToUpgradedClusterReady

func (m *Metadata) SetTimeToUpgradedClusterReady(timeToUpgradedClusterReady float64)

SetTimeToUpgradedClusterReady sets the time it took for the cluster to appear healthy on upgrade

func (*Metadata) SetUpgradeVersion

func (m *Metadata) SetUpgradeVersion(ver string)

SetUpgradeVersion sets the cluster upgrade version

func (*Metadata) SetUpgradeVersionSource

func (m *Metadata) SetUpgradeVersionSource(src string)

SetUpgradeVersionSource sets the cluster upgrade version source

func (*Metadata) WriteToJSON

func (m *Metadata) WriteToJSON(reportDir string) (err error)

WriteToJSON will marshall the metadata struct and write it into the given file.

func (*Metadata) ZeroHealthcheckIteration

func (m *Metadata) ZeroHealthcheckIteration()

ZeroHealthcheckIteration zeroes out the healthcheck counter

Jump to

Keyboard shortcuts

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