Documentation ¶
Overview ¶
Package benchmark package provides tools to run progressive or independent benchmarks against teleport services.
Index ¶
- func ExportLatencyProfile(path string, h *hdrhistogram.Histogram, ticks int32, valueScale float64) (string, error)
- type Config
- type KubeExecBenchmark
- type KubeListBenchmark
- type Linear
- type Result
- type SSHBenchmark
- type Service
- type Suite
- type WebSSHBenchmark
- type WebSessionBenchmark
- type WorkloadFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // Rate is requests per second origination rate Rate int // MinimumWindow is the min duration MinimumWindow time.Duration // MinimumMeasurments is the min amount of requests MinimumMeasurements int }
Config specifies benchmark requests to run
func (*Config) Benchmark ¶
func (c *Config) Benchmark(ctx context.Context, tc *client.TeleportClient, suite Suite) (Result, error)
Benchmark connects to remote server and executes requests in parallel according to benchmark spec. It returns a benchmark result when completed. This is a blocking function that can be canceled via context argument.
type KubeExecBenchmark ¶
type KubeExecBenchmark struct { // Namespace is the Kubernetes namespace to run the command against. Namespace string // PodName is the name of the pod to run the command against. PodName string // ContainerName is the name of the container to run the command against. ContainerName string // Command is the command to run. Command []string // Interactive turns on interactive sessions Interactive bool }
KubeListBenchmark is a benchmark suite that runs successive kubectl exec against a Teleport Kubernetes proxy for a given duration and rate.
func (KubeExecBenchmark) BenchBuilder ¶
func (k KubeExecBenchmark) BenchBuilder(ctx context.Context, tc *client.TeleportClient) (WorkloadFunc, error)
BenchBuilder returns a WorkloadFunc for the given benchmark suite.
type KubeListBenchmark ¶
type KubeListBenchmark struct { // Namespace is the Kubernetes namespace to run the command against. // If empty, it will include pods from all namespaces. Namespace string }
KubeListBenchmark is a benchmark suite that runs successive kubectl get pods against a Teleport Kubernetes proxy for a given duration and rate.
func (KubeListBenchmark) BenchBuilder ¶
func (k KubeListBenchmark) BenchBuilder(ctx context.Context, tc *client.TeleportClient) (WorkloadFunc, error)
BenchBuilder returns a WorkloadFunc for the given benchmark suite.
type Linear ¶
type Linear struct { // LowerBound is the lower end of rps to execute LowerBound int // UpperBound is the upper end of rps to execute UpperBound int // Step is the amount of rps to increment by Step int // MinimumMeasurements is the minimum measurement a benchmark should execute MinimumMeasurements int // MinimumWindow is the minimum duration to run benchmark for MinimumWindow time.Duration // contains filtered or unexported fields }
Linear generator
func (*Linear) GetBenchmark ¶
GetBenchmark returns the benchmark config for the current generation.
type Result ¶
type Result struct { // RequestsOriginated is amount of requests originated RequestsOriginated int // RequestsFailed is amount of requests failed RequestsFailed int // Histogram holds the response duration values Histogram *hdrhistogram.Histogram // LastError contains last recorded error LastError error // Duration it takes for the whole benchmark to run Duration time.Duration }
Result is a result of the benchmark
type SSHBenchmark ¶
type SSHBenchmark struct { // Command to execute on the host. Command []string // Random whether to connect to a random host or not Random bool }
SSHBenchmark is a benchmark suite that connects to the configured target hosts and executes the provided command.
func (SSHBenchmark) BenchBuilder ¶
func (s SSHBenchmark) BenchBuilder(ctx context.Context, tc *client.TeleportClient) (WorkloadFunc, error)
BenchBuilder returns a WorkloadFunc for the given benchmark suite.
type Suite ¶
type Suite interface { // BenchBuilder returns a function that executes a single benchmark call. // The returned function is called in a loop until the context is canceled. BenchBuilder(context.Context, *client.TeleportClient) (WorkloadFunc, error) }
Suite is an interface that defines a benchmark suite.
type WebSSHBenchmark ¶
type WebSSHBenchmark struct { // Command to execute on the host. Command []string // Random whether to connect to a random host or not Random bool // Duration of the test used to determine if renewing web sessions // is necessary. Duration time.Duration }
WebSSHBenchmark is a benchmark suite that connects to the configured target hosts via the web api and executes the provided command.
func (WebSSHBenchmark) BenchBuilder ¶
func (s WebSSHBenchmark) BenchBuilder(ctx context.Context, tc *client.TeleportClient) (WorkloadFunc, error)
BenchBuilder returns a WorkloadFunc for the given benchmark suite.
type WebSessionBenchmark ¶
type WebSessionBenchmark struct { // Command to execute on the host. Command []string // Max number of sessions to have open at once. Max int // Duration of the test used to determine if renewing web sessions // is necessary. Duration time.Duration // contains filtered or unexported fields }
WebSessionBenchmark is a benchmark suite that connects to the configured target hosts via the web api and executes the provided command.
func (*WebSessionBenchmark) BenchBuilder ¶
func (s *WebSessionBenchmark) BenchBuilder(ctx context.Context, tc *client.TeleportClient) (WorkloadFunc, error)
BenchBuilder returns a WorkloadFunc for the given benchmark suite.
func (*WebSessionBenchmark) Config ¶
func (s *WebSessionBenchmark) Config(ctx context.Context, tc *client.TeleportClient, cfg *Config) error
type WorkloadFunc ¶
WorkloadFunc is a function that executes a single benchmark call.