es_utils

package
v0.0.0-...-9cbff4e Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayReport

func DisplayReport(ctx context.Context, logger logr.Logger,
	run, reportType, reportSubType, reportName string,
	vcs, ucs bool,
	maxResult int,
) error

func DisplayResult

func DisplayResult(ctx context.Context, logger logr.Logger,
	run, testName string,
	vcs, ucs, passed, failed, skipped bool,
	maxResult int,
) error

func DisplayRuns

func DisplayRuns(ctx context.Context, logger logr.Logger,
	vcs, ucs bool,
	maxResult int,
) error

func DisplayUsageReport

func DisplayUsageReport(ctx context.Context, logger logr.Logger,
	run, pod, usageType string,
	vcs, ucs bool,
	maxResult int,
) error

func GetAvailableRuns

func GetAvailableRuns(ctx context.Context,
	match string, maxResult int, logger logr.Logger) (*elastic.AggregationBucketKeyItems, error)

func GetClient

func GetClient(esURL string) (*elastic.Client, error)

GetClient returns elastic client

func GetReports

func GetReports(ctx context.Context, logger logr.Logger,
	run, reportType, reportSubType, reportName string,
	vcs, ucs bool, maxResult int,
) (*elastic.SearchResult, error)

func GetResults

func GetResults(ctx context.Context, logger logr.Logger,
	run, testName string,
	vcs, ucs, passed, failed, skipped bool,
	maxResult int,
) (*elastic.SearchResult, error)

func GetUsageReports

func GetUsageReports(ctx context.Context, logger logr.Logger,
	run, pod string,
	vcs, ucs bool, maxResult int,
) (*elastic.SearchResult, error)

func VerifyIndex

func VerifyIndex(ctx context.Context, c *elastic.Client, index string) error

Types

type Report

type Report struct {
	// Type of the report
	Type string `json:"type"`
	// Name is the name of the instance this report is about
	Name string `json:"name"`
	// SubType is an optional field.
	// It can be used to further specify a type of a report.
	// If set, reports in the ReportType categories, will be aggregate by
	// SubType field.
	// For instance, when reporting a cluster is ready (all machines are up
	// and features deployed) clusters with different number of nodes will
	// have significantly different durations. So SubType will be set to
	// a string representing the number of nodes in the cluster.
	SubType string `json:"subType"`
	// Duration is the time taken in minutes
	DurationInMinutes float64 `json:"durationInMinutes"`
	// Environment represents the environment where e2e ran, i.e UCS or VCS
	Environment string `json:"environment"`
	// Run is the sanity run id
	Run int `json:"run"`
	// CreatedTime is the time entry was created
	CreatedTime time.Time `json:"createdTime"`
}

type Result

type Result struct {
	// Name is the name of the test
	Name string `json:"name"`
	// Description is the test description
	Description string `json:"description"`
	// Maintainer is the maintainer for a given test
	Maintainer string `json:"maintainer"`
	// DurationInMinutes is the duration of the test in minutes
	DurationInMinutes float64 `json:"durationInMinutes"`
	// Duration is the duration of the test in seconds
	DurationInSecond time.Duration `json:"durationInSeconds"`
	// Result indicates whether test passed or failed or it was skipped
	Result string `json:"result"`
	// Environment represents the environment where e2e ran, i.e UCS or VCS
	Environment string `json:"environment"`
	// Run is the sanity run id
	Run int `json:"run"`
	// StartTime is the time test started
	StartTime time.Time `json:"startTime"`
	// Serial indicates whether test was run in serial
	Serial bool `json:"serial"`
}

type UsageReport

type UsageReport struct {
	// Name identifies the pod this usage report is about.
	// If pod is part of a deployment, use <namespace>/<deployment name>
	// If pod is part of a daemonset, use <namespace>/<daemonset name>
	// Otherwise, use <namespace>/<pod name>
	Name string `json:"name"`
	// Memory is the max memory usage seen in Ki
	Memory int64 `json:"memory"`
	// CPU is the max CPU usage seen in m
	CPU int64 `json:"cpu"`
	// MemoryLimit is the pod memory limit in Ki
	MemoryLimit int64 `json:"memoryLimit"`
	// CPULimit is the pod CPU limit in m
	CPULimit int64 `json:"cpuLimit"`
	// Environment represents the environment where e2e ran, i.e UCS or VCS
	Environment string `json:"environment"`
	// Run is the sanity run id
	Run int `json:"run"`
	// CreatedTime is the time entry was created
	CreatedTime time.Time `json:"createdTime"`
}

Jump to

Keyboard shortcuts

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