Files
iris-context/commands/ops/k6.go
VERSE ebde9ba68f refactor(commands): separate commands and its core into two folders (#32)
- I think it would be better if one for commands only, one for the spec
handling core logic so people won't be confused by the core logic inside
the commands folder (cleaner I guess)
- Regen docs
2026-07-05 11:27:30 +07:00

107 lines
7.1 KiB
Go

package ops
import (
"github.com/versenilvis/iris/spec"
)
func init() {
spec.Register(&spec.Spec{
Name: "k6",
Description: "Create an archive",
Subcommands: []spec.Subcommand{
{Name: "archive", Description: "Create an archive"},
{Name: "cloud", Description: "Run a test on the cloud"},
{Name: "completion", Description: "Generate the autocompletion script for the specified shell"},
{Name: "bash", Description: "Generate the autocompletion script for bash"},
{Name: "fish", Description: "Generate the autocompletion script for fish"},
{Name: "powershell", Description: "Generate the autocompletion script for powershell"},
{Name: "zsh", Description: "Generate the autocompletion script for zsh"},
{Name: "convert", Description: "Convert a HAR file to a k6 script"},
{Name: "help", Description: "Help about any command"},
{Name: "inspect", Description: "Inspect a script or archive"},
{Name: "login", Description: "Inspect a script or archive"},
{Name: "influxdb", Description: "Authenticate with InfluxDB"},
{Name: "pause", Description: "Pause a running test"},
{Name: "resume", Description: "Resume a running test"},
{Name: "run", Description: "Start a load test"},
{Name: "address", Description: "Address of the API server"},
{Name: "batch", Description: "Max parallel batch reqs (default 20)"},
{Name: "batch-per-host", Description: "Max parallel batch reqs per host (default 6)"},
{Name: "vus", Description: "Number of virtual users (default 1)"},
{Name: "duration", Description: "Test duration limit"},
{Name: "iterations", Description: "Script total iteration limit (among all VUs)"},
{Name: "stage", Description: "Add a stage, as `[duration]:[target]`"},
{Name: "execution-segment", Description: "Limit execution to the specified segment, e.g. 10%, 1/3, 0.2:2/3"},
{Name: "execution-segment-sequence", Description: "The execution segment sequence"},
{Name: "paused", Description: "Start the test in a paused state"},
{Name: "no-setup", Description: "Don't run setup()"},
{Name: "no-teardown", Description: "Don't run teardown()"},
{Name: "max-redirects", Description: "Follow at most n redirects (default 10)"},
{Name: "rps", Description: "Limit requests per second"},
{Name: "insecure-skip-tls-verify", Description: "Skip verification of TLS certificates"},
{Name: "no-connection-reuse", Description: "Disable keep-alive connections"},
{Name: "no-vu-connection-reuse", Description: "Don't reuse connections between iterations"},
{Name: "min-iteration-duration", Description: "Minimum amount of time k6 will take executing a single iteration"},
{Name: "throw", Description: "Throw warnings (like failed http requests) as errors"},
{Name: "blacklist-ip", Description: "Blacklist an ip range from being calledd"},
{Name: "tag", Description: "Add a tag to be applied to all samples, as `[name]=[value]`"},
{Name: "console-output", Description: "Redirects the console logging to the provided output file"},
{Name: "discard-response-bodies", Description: "Read but don't process or save HTTP response bodies"},
{Name: "dns", Description: "DNS resolver configuration"},
{Name: "include-system-env-vars", Description: "Pass the real system environment variables to the runtime (default true)"},
{Name: "env", Description: "Add/override environment variable with VAR=value"},
{Name: "no-thresholds", Description: "Don't run thresholds"},
{Name: "no-summary", Description: "Don't show the summary at the end of the test"},
{Name: "summary-export", Description: "Output the end-of-test summary report to JSON file"},
{Name: "out", Description: "Uri for an external metrics database"},
{Name: "linger", Description: "Keep the API server alive past test end"},
{Name: "no-usage-report", Description: "Don't send anonymous stats to the developers"},
{Name: "scale", Description: "Scale a running test"},
{Name: "max", Description: "Max available virtual users"},
{Name: "stats", Description: "Show test metrics"},
},
Options: []spec.Option{
{Name: "--address", Description: "Address of the API server"},
{Name: "--batch", Description: "Max parallel batch reqs (default 20)"},
{Name: "--batch-per-host", Description: "Max parallel batch reqs per host (default 6)"},
{Name: "--vus", Description: "Number of virtual users (default 1)"},
{Name: "--duration", Description: "Test duration limit"},
{Name: "--iterations", Description: "Script total iteration limit (among all VUs)"},
{Name: "--stage", Description: "Add a stage, as `[duration]:[target]`"},
{Name: "--execution-segment", Description: "Add a stage, as `[duration]:[target]`"},
{Name: "--execution-segment-sequence", Description: "The execution segment sequence"},
{Name: "--paused", Description: "Start the test in a paused state"},
{Name: "--no-setup", Description: "Don't run setup()"},
{Name: "--no-teardown", Description: "Don't run teardown()"},
{Name: "--max-redirects", Description: "Follow at most n redirects (default 10)"},
{Name: "--rps", Description: "Limit requests per second"},
{Name: "--user-agent", Description: "Skip verification of TLS certificates"},
{Name: "--no-connection-reuse", Description: "Disable keep-alive connections"},
{Name: "--no-vu-connection-reuse", Description: "Don't reuse connections between iterations"},
{Name: "--min-iteration-duration", Description: "Minimum amount of time k6 will take executing a single iteration"},
{Name: "--throw", Description: "Throw warnings (like failed http requests) as errors"},
{Name: "--blacklist-ip", Description: "Blacklist an ip range from being called"},
{Name: "--block-hostnames", Description: "Add a tag to be applied to all samples, as `[name]=[value]`"},
{Name: "--console-output", Description: "Redirects the console logging to the provided output file"},
{Name: "--discard-response-bodies", Description: "Read but don't process or save HTTP response bodies"},
{Name: "--local-ips", Description: "DNS resolver configuration"},
{Name: "--include-system-env-vars", Description: "Pass the real system environment variables to the runtime (default true)"},
{Name: "--compatibility-mode", Description: "Add/override environment variable with VAR=value"},
{Name: "--no-thresholds", Description: "Don't run thresholds"},
{Name: "--no-summary", Description: "Don't show the summary at the end of the test"},
{Name: "--summary-export", Description: "Output the end-of-test summary report to JSON file"},
{Name: "--out", Description: "Uri for an external metrics database"},
{Name: "--linger", Description: "Keep the API server alive past test end"},
{Name: "--no-usage-report", Description: "Don't send anonymous stats to the developers"},
{Name: "-h", Description: "Help for scale"},
{Name: "-m", Description: "Max available virtual users"},
{Name: "-u", Description: "Number of virtual users (default 1)"},
{Name: "-v", Description: "Enable verbose logging"},
{Name: "-q", Description: "Disable progress updates"},
{Name: "-a", Description: "JSON config file"},
{Name: "--log-format", Description: "Log output format"},
{Name: "--log-output", Description: "Change the output for k6 logs"},
},
})
}