Documentation ¶
Index ¶
- type Fortio
- type K6
- type K6CounterMetric
- type K6GaugeMetric
- type K6Interface
- type K6Opt
- func DisableDapr() K6Opt
- func EnableLog() K6Opt
- func WithAppID(appID string) K6Opt
- func WithCtx(ctx context.Context) K6Opt
- func WithMemoryLimits(daprRequest, daprLimit, appRequest, appLimit string) K6Opt
- func WithName(name string) K6Opt
- func WithNamespace(namespace string) K6Opt
- func WithParallelism(p int) K6Opt
- func WithRunnerEnvVar(name, value string) K6Opt
- func WithRunnerImage(image string) K6Opt
- func WithScript(script string) K6Opt
- type K6RateMetric
- type K6RunnerMetricsSummary
- type K6RunnerSummary
- type K6TestSummary
- type K6TrendMetric
- type Opt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fortio ¶
type Fortio struct {
// contains filtered or unexported fields
}
Fortio is used for executing tests using the fortio load testing tool.
type K6 ¶
type K6 struct {
// contains filtered or unexported fields
}
K6 is used for executing tests using the k6 load testing tool.
type K6CounterMetric ¶
type K6CounterMetric struct { Type string `json:"type"` Contains string `json:"contains"` Values struct { Count float64 `json:"count"` Rate float64 `json:"rate"` } `json:"values"` }
K6CounterMetric is a metric that has only count and rate
type K6GaugeMetric ¶
type K6GaugeMetric struct { Type string `json:"type"` Contains string `json:"contains"` Values struct { Max int `json:"max"` P90 int `json:"p(90)"` P95 int `json:"p(95)"` Avg int `json:"avg"` Min int `json:"min"` Med int `json:"med"` } `json:"values"` }
K6GaugeMetric is the representation of a k6 gauge
type K6Interface ¶
type K6Opt ¶
type K6Opt = func(*K6)
func EnableLog ¶
func EnableLog() K6Opt
EnableLog enables the console output debugging. This should be deactivated when running in production to avoid errors when parsing the test result.
func WithMemoryLimits ¶
WithMemoryLimits set app and dapr memory limits
func WithNamespace ¶
WithNamespace sets the test namespace.
func WithParallelism ¶
WithParallelism configures the number of parallel runners at once.
func WithRunnerEnvVar ¶
WithRunnerEnvVar adds a new env variable to the runner.
func WithRunnerImage ¶
WithRunnerImage sets the runner image, defaults to k6-custom.
type K6RateMetric ¶
type K6RateMetric struct { Type string `json:"type"` Contains string `json:"contains"` Values struct { Rate float64 `json:"rate"` Passes int `json:"passes"` Fails int `json:"fails"` } `json:"values"` }
K6Rate metric is the representation of a k6 rate metric
type K6RunnerMetricsSummary ¶
type K6RunnerMetricsSummary struct { Iterations K6CounterMetric `json:"iterations"` HTTPReqConnecting K6TrendMetric `json:"http_req_connecting"` HTTPReqTLSHandshaking K6TrendMetric `json:"http_req_tls_handshaking"` HTTPReqReceiving K6TrendMetric `json:"http_req_receiving"` HTTPReqWaiting K6TrendMetric `json:"http_req_waiting"` HTTPReqSending K6TrendMetric `json:"http_req_sending"` Checks K6RateMetric `json:"checks"` DataReceived K6CounterMetric `json:"data_received"` VusMax K6GaugeMetric `json:"vus_max"` HTTPReqDurationExpectedResponse *K6TrendMetric `json:"http_req_duration{expected_response:true}"` HTTPReqDurationNonExpectedResponse *K6TrendMetric `json:"http_req_duration{expected_response:false}"` Vus K6GaugeMetric `json:"vus"` HTTPReqFailed K6RateMetric `json:"http_req_failed"` IterationDuration K6TrendMetric `json:"iteration_duration"` HTTPReqBlocked K6TrendMetric `json:"http_req_blocked"` HTTPReqs K6CounterMetric `json:"http_http_reqs"` DataSent K6CounterMetric `json:"data_sent"` HTTPReqDuration K6TrendMetric `json:"http_req_duration"` }
K6RunnerMetricsSummary represents a single unit of testing result.
type K6RunnerSummary ¶
type K6RunnerSummary[T any] struct { Metrics T `json:"metrics"` }
type K6TestSummary ¶
type K6TestSummary[T any] struct { Pass bool `json:"pass"` RunnersResults []*T `json:"runnersResults"` }
K6TestSummary is the wrapped k6 results collected for all runners.
func K6Result ¶
func K6Result[T any](k6 *K6) (*K6TestSummary[T], error)
K6Result extract the test summary results from pod logs.
func K6ResultDefault ¶
func K6ResultDefault(k6 *K6) (*K6TestSummary[K6RunnerMetricsSummary], error)
K6ResultDefault exports results to k6 default metrics.
type K6TrendMetric ¶
type K6TrendMetric struct { Type string `json:"type"` Contains string `json:"contains"` Values struct { Max float64 `json:"max"` P90 float64 `json:"p(90)"` P95 float64 `json:"p(95)"` Avg float64 `json:"avg"` Min float64 `json:"min"` Med float64 `json:"med"` } `json:"values"` }
K6TrendMetric is the representation of a k6 trendmetric
type Opt ¶
type Opt = func(*Fortio)
func WithAffinity ¶
WithAffinity sets the pod affinity for the fortio pod.
func WithNumHealthChecks ¶
WithNumHealthChecks set the number of initial healthchecks that should be made before executing the test.
func WithParams ¶
func WithParams(params perf.TestParameters) Opt
WithParams set the test parameters.
func WithTestAppName ¶
WithTestAppName sets the app name to be used.
func WithTesterImage ¶
WithTesterImage sets the tester image (defaults to perf-tester).