performance

package
v0.41.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchDeploymentStatus

func FetchDeploymentStatus(
	ctx context.Context, namespace, name string, duration time.Duration,
) <-chan DeploymentStatus

FetchDeploymentStatus creates a channel that can return the up-to-date DeploymentStatus periodically, selected via deployment name (at most one deployment).

func FetchDeploymentsStatus

func FetchDeploymentsStatus(
	ctx context.Context, namespace string, selector labels.Selector,
	duration time.Duration,
) <-chan DeploymentStatus

FetchDeploymentsStatus creates a channel that can return the up-to-date DeploymentStatus periodically, selected via a label selector (can be more than one deployment).

func FetchRouteStatus

func FetchRouteStatus(ctx context.Context, namespace, name string, duration time.Duration) <-chan RouteStatus

FetchRouteStatus returns a channel that will contain the traffic distribution at regular time intervals.

func FetchSKSStatus

func FetchSKSStatus(
	ctx context.Context, namespace string, selector labels.Selector,
	duration time.Duration,
) <-chan ServerlessServiceStatus

FetchSKSStatus creates a channel that can return the up-to-date ServerlessServiceOperationMode periodically.

func ProbeTargetTillReady

func ProbeTargetTillReady(target string, duration time.Duration) error

ProbeTargetTillReady will probe the target once per second for the given duration, until it's ready or error happens

func WaitForScaleToZero

func WaitForScaleToZero(ctx context.Context, namespace string, selector labels.Selector, duration time.Duration) error

WaitForScaleToZero will wait for the deployments in the indexer to scale to 0

Types

type DeploymentStatus

type DeploymentStatus struct {
	DesiredReplicas int32
	ReadyReplicas   int32
	DeploymentName  string
	// Time is the time when the status is fetched
	Time time.Time
}

DeploymentStatus is a struct that wraps the status of a deployment.

type InfluxReporter

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

InfluxReporter wraps a influxdb client

func NewInfluxReporter

func NewInfluxReporter(tags map[string]string) (*InfluxReporter, error)

NewInfluxReporter creates a InfluxReporter The method expects tags to be provided as a map. These are used to identify different runs.

func (*InfluxReporter) AddDataPoint

func (ir *InfluxReporter) AddDataPoint(measurement string, fields map[string]interface{})

AddDataPoint asynchronously writes a new data-point to influxdb.

func (*InfluxReporter) AddDataPointsForMetrics

func (ir *InfluxReporter) AddDataPointsForMetrics(m *vegeta.Metrics, benchmarkName string)

AddDataPointsForMetrics reports vegeta.Metrics to influxdb

func (*InfluxReporter) FlushAndShutdown

func (ir *InfluxReporter) FlushAndShutdown()

FlushAndShutdown flushes the data to influxdb and terminates the client.

type RouteStatus

type RouteStatus struct {
	Traffic []v1.TrafficTarget
	Time    time.Time
}

RouteStatus contains the traffic distribution at the probe time.

type ServerlessServiceStatus

type ServerlessServiceStatus struct {
	Mode          netv1alpha1.ServerlessServiceOperationMode
	NumActivators int32
	// Time is the time when the status is fetched
	Time time.Time
}

ServerlessServiceStatus is a struct that wraps the status of a serverless service.

type VegetaReporter

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

VegetaReporter wraps vegeta.Metrics to report metrics via channels. Call StopAndCollectMetrics() to finish reporting and return the collected metrics.

func NewVegetaReporter

func NewVegetaReporter() *VegetaReporter

NewVegetaReporter creates a new VegetaReporter.

func (*VegetaReporter) AddResult

func (vr *VegetaReporter) AddResult(r *vegeta.Result)

AddResult adds a results asynchronously.

func (*VegetaReporter) StopAndCollectMetrics

func (vr *VegetaReporter) StopAndCollectMetrics() *vegeta.Metrics

StopAndCollectMetrics flushes the metrics and collects latency distribution, shuts down the reporter and returns the collected metrics.

Jump to

Keyboard shortcuts

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