reportingframework

package
v0.0.0-...-8ce62a0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: Apache-2.0 Imports: 30 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReportingFramework

type ReportingFramework struct {
	MeteringClient        metering.MeteringV1Interface
	KubeClient            kubernetes.Interface
	HTTPClient            *http.Client
	RouteClient           routev1client.RouteV1Client
	Namespace             string
	DefaultTimeout        time.Duration
	ReportOutputDirectory string

	KubeAPIURL  *url.URL
	KubeAPIPath string

	UseKubeProxyForReportingAPI bool
	UseRouteForReportingAPI     bool
	RouteBearerToken            string
	ReportingAPIURL             *url.URL
	HTTPSAPI                    bool
	// contains filtered or unexported fields
}

func New

func New(
	httpsAPI,
	useKubeProxyForReportingAPI,
	useRouteForReportingAPI bool,
	namespace,
	routeBearerToken,
	reportingAPIURL,
	reportOutputDir string,
	kubeconfig *rest.Config,
	kubeClient kubernetes.Interface,
	meteringClient metering.MeteringV1Interface,
) (*ReportingFramework, error)

New initializes a test reporting framework and returns it.

func (*ReportingFramework) CollectMetricsOnce

func (*ReportingFramework) CreateMeteringReport

func (rf *ReportingFramework) CreateMeteringReport(report *metering.Report) error

func (*ReportingFramework) GetMeteringReport

func (rf *ReportingFramework) GetMeteringReport(name string) (*metering.Report, error)

func (*ReportingFramework) GetMeteringReportDataSource

func (rf *ReportingFramework) GetMeteringReportDataSource(name string) (*metering.ReportDataSource, error)

func (*ReportingFramework) GetMeteringReportQuery

func (rf *ReportingFramework) GetMeteringReportQuery(name string) (*metering.ReportQuery, error)

func (*ReportingFramework) GetPrestoTable

func (rf *ReportingFramework) GetPrestoTable(name string) (*metering.PrestoTable, error)

func (*ReportingFramework) GetReportResults

func (rf *ReportingFramework) GetReportResults(t *testing.T, report *metering.Report, waitTimeout time.Duration) []map[string]interface{}

func (*ReportingFramework) NewSimpleReport

func (rf *ReportingFramework) NewSimpleReport(name, queryName string, schedule *metering.ReportSchedule, reportingStart, reportingEnd *time.Time) *metering.Report

func (*ReportingFramework) PrestoTableExists

func (rf *ReportingFramework) PrestoTableExists(t *testing.T, name string) (bool, error)

func (*ReportingFramework) ReportingOperatorPOSTRequest

func (rf *ReportingFramework) ReportingOperatorPOSTRequest(endpoint string, body []byte) (respBody []byte, code int, err error)

func (*ReportingFramework) ReportingOperatorRequest

func (rf *ReportingFramework) ReportingOperatorRequest(endpoint string, query map[string]string) (respBody []byte, code int, err error)

func (*ReportingFramework) RequireReportDataSourcesForQueryHaveData

func (rf *ReportingFramework) RequireReportDataSourcesForQueryHaveData(t *testing.T, queries []string, collectResp operator.CollectPrometheusMetricsDataResponse)

func (*ReportingFramework) RequireReportQueriesReady

func (rf *ReportingFramework) RequireReportQueriesReady(t *testing.T, queries []string, pollInterval, timeout time.Duration)

func (*ReportingFramework) RequireReportSuccessfullyRuns

func (rf *ReportingFramework) RequireReportSuccessfullyRuns(t *testing.T, report *metering.Report, waitTimeout time.Duration)

func (*ReportingFramework) StoreDataSourceData

func (rf *ReportingFramework) StoreDataSourceData(dataSourceName string, metrics []*prestostore.PrometheusMetric) error

func (*ReportingFramework) WaitForAllMeteringReportDataSourceTables

func (rf *ReportingFramework) WaitForAllMeteringReportDataSourceTables(t *testing.T, pollInterval, timeout time.Duration) ([]*metering.ReportDataSource, error)

func (*ReportingFramework) WaitForMeteringReportDataSource

func (rf *ReportingFramework) WaitForMeteringReportDataSource(t *testing.T, name string, pollInterval, timeout time.Duration, dsFunc func(ds *metering.ReportDataSource) (bool, error)) (*metering.ReportDataSource, error)

func (*ReportingFramework) WaitForMeteringReportDataSourceTable

func (rf *ReportingFramework) WaitForMeteringReportDataSourceTable(t *testing.T, name string, pollInterval, timeout time.Duration) (*metering.ReportDataSource, error)

func (*ReportingFramework) WaitForMeteringReportQuery

func (rf *ReportingFramework) WaitForMeteringReportQuery(t *testing.T, name string, pollInterval, timeout time.Duration) (*metering.ReportQuery, error)

func (*ReportingFramework) WaitForPrestoTable

func (rf *ReportingFramework) WaitForPrestoTable(t *testing.T, name string, pollInterval, timeout time.Duration, tableFunc func(table *metering.PrestoTable) (bool, error)) (*metering.PrestoTable, error)

func (*ReportingFramework) WaitForReportDataSourcePrestoTable

func (rf *ReportingFramework) WaitForReportDataSourcePrestoTable(t *testing.T, ds *metering.ReportDataSource, pollInterval, timeout time.Duration) (bool, error)

Jump to

Keyboard shortcuts

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