Documentation ¶
Index ¶
- func FetchDeploymentStatus(ctx context.Context, namespace, name string, duration time.Duration) <-chan DeploymentStatus
- func FetchDeploymentsStatus(ctx context.Context, namespace string, selector labels.Selector, ...) <-chan DeploymentStatus
- func FetchRouteStatus(ctx context.Context, namespace, name string, duration time.Duration) <-chan RouteStatus
- func FetchSKSStatus(ctx context.Context, namespace string, selector labels.Selector, ...) <-chan ServerlessServiceStatus
- func ProbeTargetTillReady(target string, duration time.Duration) error
- func WaitForScaleToZero(ctx context.Context, namespace string, selector labels.Selector, ...) error
- type DeploymentStatus
- type InfluxReporter
- type RouteStatus
- type ServerlessServiceStatus
- type VegetaReporter
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 ¶
ProbeTargetTillReady will probe the target once per second for the given duration, until it's ready or error happens
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.