metrics

package
v0.0.0-...-604da00 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Install phase represents tests that were run after the initial installation of the cluster.
	Install Phase = "install"

	// Upgrade phase represents tests that were run after the upgrade of the cluster.
	Upgrade Phase = "upgrade"

	// UnknownPhase represents tests that were run in a phase that is currently unknown to the metrics library.
	UnknownPhase Phase = "unknown"

	// Passed result represents a JUnitResult that passed acceptably.
	Passed Result = "passed"

	// Failed result represents a JUnitResult that failed.
	Failed Result = "failed"

	// Skipped result represents a JUnitResult that was skipped during a run.
	Skipped Result = "skipped"

	// UnknownResult represents a JUnitResult that is currently unknown to the metrics library.
	UnknownResult Result = "unknown"
)

Variables

View Source
var AllJobs = regexp.MustCompile(".*")

AllJobs represents a regex that will collect results from all jobs.

Functions

This section is empty.

Types

type AddonMetadata

type AddonMetadata struct {
	Metadata

	// Phase is the test phase where this this metadata was generated in.
	Phase Phase
}

AddonMetadata is numerical data captured by osde2e runs, similar to Metadata. However, this is customizable and focused on addon testing.

func (AddonMetadata) Equal

func (a AddonMetadata) Equal(that AddonMetadata) bool

Equal will return true if two addon metadata objects are equal.

type AddonMetadatas

type AddonMetadatas []AddonMetadata

AddonMetadatas is a list of addon metadata objects.

func (AddonMetadatas) Len

func (a AddonMetadatas) Len() int

func (AddonMetadatas) Less

func (a AddonMetadatas) Less(i, k int) bool

func (AddonMetadatas) Swap

func (a AddonMetadatas) Swap(i, j int)

type Client

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

Client is a metrics client that can be used to query osde2e's metrics.

func NewClient

func NewClient(args ...string) (*Client, error)

NewClient returns a new metrics client. If no arguments are supplied, the global config will be used. If one argument is supplied, it will be used as the address for Prometheus, but will use the global config for the bearer token. If two arguments are supplied, the first will be used as the address for Prometheus and the second will be used as the bearer token.

func (*Client) GetPassRateForJob

func (c *Client) GetPassRateForJob(jobName string, begin, end time.Time) (float64, error)

GetPassRateForJob will return the pass rate for a given job.

func (*Client) ListAddonMetadataByClusterID

func (c *Client) ListAddonMetadataByClusterID(cloudProvider, environment, clusterID string, begin, end time.Time) ([]AddonMetadata, error)

ListAddonMetadataByClusterID will list all addon metadata seen in the given time range using the given provider, environment, and cluster ID.

func (*Client) ListAddonMetadataByJobNameAndJobID

func (c *Client) ListAddonMetadataByJobNameAndJobID(jobName string, jobID int64, begin, end time.Time) ([]AddonMetadata, error)

ListAddonMetadataByJobNameAndJobID will list all addon metadata seen in the given time range using the given job name and job ID.

func (*Client) ListAllAddonMetadata

func (c *Client) ListAllAddonMetadata(begin, end time.Time) ([]AddonMetadata, error)

ListAllAddonMetadata will list all addon metadata seen in the given time range.

func (*Client) ListAllCloudProviders

func (c *Client) ListAllCloudProviders(begin, end time.Time) ([]string, error)

ListAllCloudProviders will list all of the individual cloud providers in the given range.

func (*Client) ListAllClusterIDs

func (c *Client) ListAllClusterIDs(cloudProvider, environment string, begin, end time.Time) ([]string, error)

ListAllClusterIDs will list all of the individual cluster IDs for an provider and environment in the given range.

func (*Client) ListAllEnvironments

func (c *Client) ListAllEnvironments(cloudProvider string, begin, end time.Time) ([]string, error)

ListAllEnvironments will list all of the environments for a cloud provider in the given range.

func (*Client) ListAllEvents

func (c *Client) ListAllEvents(begin, end time.Time) ([]Event, error)

ListAllEvents will list all events seen in the given time range.

func (*Client) ListAllJUnitResults

func (c *Client) ListAllJUnitResults(begin, end time.Time) ([]JUnitResult, error)

ListAllJUnitResults will return all JUnitResults in the given time range.

func (*Client) ListAllJobIDs

func (c *Client) ListAllJobIDs(jobName string, begin, end time.Time) ([]int64, error)

ListAllJobIDs will list all of the individual job IDs (individual job runs) for a given job in the given range.

func (*Client) ListAllJobNames

func (c *Client) ListAllJobNames(begin, end time.Time) ([]string, error)

ListAllJobNames will give a list of all of the osde2e jobs names seen in the given range.

func (*Client) ListAllMetadata

func (c *Client) ListAllMetadata(begin, end time.Time) ([]Metadata, error)

ListAllMetadata will list all metadata seen in the given time range.

func (*Client) ListEventsByClusterID

func (c *Client) ListEventsByClusterID(cloudProvider, environment, clusterID string, begin, end time.Time) ([]Event, error)

ListEventsByClusterID will list all events seen in the given time range using the given cloud provider, environment, and cluster ID.

func (*Client) ListEventsByJobNameAndJobID

func (c *Client) ListEventsByJobNameAndJobID(jobName string, jobID int64, begin, end time.Time) ([]Event, error)

ListEventsByJobNameAndJobID will list all events seen in the given time range using the given job ID.

func (*Client) ListFailedJUnitResultsByTestName

func (c *Client) ListFailedJUnitResultsByTestName(testName string, begin, end time.Time) ([]JUnitResult, error)

ListFailedJUnitResultsByTestName will return all JUnitResults in a given time range for a given test name.

func (*Client) ListJUnitResultsByClusterID

func (c *Client) ListJUnitResultsByClusterID(cloudProvider, environment, clusterID string, begin, end time.Time) ([]JUnitResult, error)

ListJUnitResultsByClusterID will return all JUnitResults in the given time range for the given cloud provider, environment, and cluster ID.

func (*Client) ListJUnitResultsByJobName

func (c *Client) ListJUnitResultsByJobName(jobName string, begin, end time.Time) ([]JUnitResult, error)

ListJUnitResultsByJobName will return all JUnitResults in the given time range for the given job name across job IDs.

func (*Client) ListJUnitResultsByJobNameAndJobID

func (c *Client) ListJUnitResultsByJobNameAndJobID(jobName string, jobID int64, begin, end time.Time) ([]JUnitResult, error)

ListJUnitResultsByJobNameAndJobID will return all JUnitResults in the given time range for the given job name and ID.

func (*Client) ListMetadataByClusterID

func (c *Client) ListMetadataByClusterID(cloudProvider, environment, clusterID string, begin, end time.Time) ([]Metadata, error)

ListMetadataByClusterID will list all metadata seen in the given time range using the given cloud provider, environment, and cluster ID.

func (*Client) ListMetadataByJobNameAndJobID

func (c *Client) ListMetadataByJobNameAndJobID(jobName string, jobID int64, begin, end time.Time) ([]Metadata, error)

ListMetadataByJobNameAndJobID will list all metadata seen in the given time range using the given job name and job ID.

func (*Client) ListPassRatesByJob

func (c *Client) ListPassRatesByJob(begin, end time.Time) (map[string]float64, error)

ListPassRatesByJob will return a map of job names to their corresponding pass rates.

func (*Client) ListPassRatesByJobID

func (c *Client) ListPassRatesByJobID(jobName string, begin, end time.Time) (map[int64]float64, error)

ListPassRatesByJobID will return a map of job IDs to their corresponding pass rates given a job name.

type Event

type Event struct {
	// InstallVersion is the starting install version of the cluster that generated this event.
	InstallVersion *semver.Version

	// UpgradeVersion is the upgrade version of the cluster that generated this event. This can be nil.
	UpgradeVersion *semver.Version

	// CloudProvider is the cluster cloud provider that was used when this event was generated.
	CloudProvider string

	// Environment is the environment that the cluster provider was using during the generation of this event.
	Environment string

	// Event is the name of the event that was recorded.
	Event string

	// ClusterID is the cluster ID of the cluster that was provisioned while generating this event.
	ClusterID string

	// JobName is the name of the job that generated this event.
	JobName string

	// JobID is the job ID number that corresponds to the job that generated this event.
	JobID int64

	// Timestamp is the time when this event was recorded.
	Timestamp int64
}

Event objects that are recorded by osde2e runs. These typically represent occurrences that are of some note. For example, cluste provisioning failure, failure to collect Hive logs, etc.

func (Event) Equal

func (e Event) Equal(that Event) bool

Equal will return true if two event objects are equal.

type Events

type Events []Event

Events is a list of events.

func (Events) Len

func (e Events) Len() int

func (Events) Less

func (e Events) Less(i, k int) bool

func (Events) Swap

func (e Events) Swap(i, j int)

type JUnitResult

type JUnitResult struct {
	// InstallVersion is the starting install version of the cluster that generated this result.
	InstallVersion *semver.Version

	// UpgradeVersion is the upgrade version of the cluster that generated this result. This can be nil.
	UpgradeVersion *semver.Version

	// CloudProvider is the cluster cloud provider that was used when this result was generated.
	CloudProvider string

	// Environment is the environment that the cluster provider was using during the generation of this result.
	Environment string

	// Suite is the name of the test suite that this test belongs to.
	Suite string

	// TestName is the name of the test that was run.
	TestName string

	// Result is the result of this test.
	Result Result

	// ClusterID is the cluster ID of the cluster that was provisioned while generating this result.
	ClusterID string

	// JobName is the name of the job that generated this result.
	JobName string

	// JobID is the job ID number that corresponds to the job that generated this result.
	JobID int64

	// Phase is the test phase where this this result was generated in.
	Phase Phase

	// Duration is the length of time that this test took to run.
	Duration time.Duration

	// Timestamp is the timestamp when this result was recorded.
	Timestamp int64
}

JUnitResult represents an individual test that was run over the course of an osde2e run.

func (JUnitResult) Equal

func (j JUnitResult) Equal(that JUnitResult) bool

Equal will return true if two JUnitResult objects are equal.

type JUnitResults

type JUnitResults []JUnitResult

JUnitResults is a list of JUnitResults.

func (JUnitResults) Len

func (jr JUnitResults) Len() int

func (JUnitResults) Less

func (jr JUnitResults) Less(i, k int) bool

func (JUnitResults) Swap

func (jr JUnitResults) Swap(i, j int)

type Metadata

type Metadata struct {
	// InstallVersion is the starting install version of the cluster that generated this metadata.
	InstallVersion *semver.Version

	// UpgradeVersion is the upgrade version of the cluster that generated this metadata. This can be nil.
	UpgradeVersion *semver.Version

	// CloudProvider is the cluster cloud provider that was used when this metadata was generated.
	CloudProvider string

	// Environment is the environment that the cluster provider was using during the generation of this metadata.
	Environment string

	// MetadataName is the name of the metadata that was recorded.
	MetadataName string

	// ClusterID is the cluster ID of the cluster that was provisioned while generating this metadata.
	ClusterID string

	// JobName is the name of the job that generated this metadata.
	JobName string

	// JobID is the job ID number that corresponds to the job that generated this metadata.
	JobID int64

	// Value is the numerical value associated with this metadata.
	Value float64

	// Time is the time when this metadata was recorded.
	Timestamp int64
}

Metadata objects are numerical values associated with metadata calculated by osde2e.

func (Metadata) Equal

func (m Metadata) Equal(that Metadata) bool

Equal will return true if two metadata objects are equal.

type Metadatas

type Metadatas []Metadata

Metadatas is a list of metadata objects.

func (Metadatas) Len

func (m Metadatas) Len() int

func (Metadatas) Less

func (m Metadatas) Less(i, k int) bool

func (Metadatas) Swap

func (m Metadatas) Swap(i, j int)

type Phase

type Phase string

Phase is a phase of an osde2e run.

type Result

type Result string

Result is the result of a JUnit test.

Jump to

Keyboard shortcuts

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