mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(cli): add trafficgen command for load testing (#7307)
This PR adds a scaletest workspace-traffic command for load testing. This opens a
ReconnectingPTY connection to each scaletest workspace (via coderd) and
concurrently writes and reads random data to/from the PTY. Payloads are of the
form #${RANDOM_ALPHANUMERIC_STRING}, which essentially drops garbage
comments in the remote shell, and should not result in any commands being executed.
This commit is contained in:
@@ -16,3 +16,4 @@ coder scaletest
|
||||
| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [<code>cleanup</code>](./scaletest_cleanup.md) | Cleanup scaletest workspaces, then cleanup scaletest users. |
|
||||
| [<code>create-workspaces</code>](./scaletest_create-workspaces.md) | Creates many users, then creates a workspace for each user and waits for them finish building and fully come online. Optionally runs a command inside each workspace, and connects to the workspace over WireGuard. |
|
||||
| [<code>workspace-traffic</code>](./scaletest_workspace-traffic.md) | Generate traffic to scaletest workspaces through coderd |
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
<!-- DO NOT EDIT | GENERATED CONTENT -->
|
||||
|
||||
# scaletest workspace-traffic
|
||||
|
||||
Generate traffic to scaletest workspaces through coderd
|
||||
|
||||
## Usage
|
||||
|
||||
```console
|
||||
coder scaletest workspace-traffic [flags]
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
### --bytes-per-tick
|
||||
|
||||
| | |
|
||||
| ----------- | -------------------------------------------------------------- |
|
||||
| Type | <code>int</code> |
|
||||
| Environment | <code>$CODER_SCALETEST_WORKSPACE_TRAFFIC_BYTES_PER_TICK</code> |
|
||||
| Default | <code>1024</code> |
|
||||
|
||||
How much traffic to generate per tick.
|
||||
|
||||
### --cleanup-concurrency
|
||||
|
||||
| | |
|
||||
| ----------- | ------------------------------------------------- |
|
||||
| Type | <code>int</code> |
|
||||
| Environment | <code>$CODER_SCALETEST_CLEANUP_CONCURRENCY</code> |
|
||||
| Default | <code>1</code> |
|
||||
|
||||
Number of concurrent cleanup jobs to run. 0 means unlimited.
|
||||
|
||||
### --cleanup-job-timeout
|
||||
|
||||
| | |
|
||||
| ----------- | ------------------------------------------------- |
|
||||
| Type | <code>duration</code> |
|
||||
| Environment | <code>$CODER_SCALETEST_CLEANUP_JOB_TIMEOUT</code> |
|
||||
| Default | <code>5m</code> |
|
||||
|
||||
Timeout per job. Jobs may take longer to complete under higher concurrency limits.
|
||||
|
||||
### --cleanup-timeout
|
||||
|
||||
| | |
|
||||
| ----------- | --------------------------------------------- |
|
||||
| Type | <code>duration</code> |
|
||||
| Environment | <code>$CODER_SCALETEST_CLEANUP_TIMEOUT</code> |
|
||||
| Default | <code>30m</code> |
|
||||
|
||||
Timeout for the entire cleanup run. 0 means unlimited.
|
||||
|
||||
### --concurrency
|
||||
|
||||
| | |
|
||||
| ----------- | ----------------------------------------- |
|
||||
| Type | <code>int</code> |
|
||||
| Environment | <code>$CODER_SCALETEST_CONCURRENCY</code> |
|
||||
| Default | <code>1</code> |
|
||||
|
||||
Number of concurrent jobs to run. 0 means unlimited.
|
||||
|
||||
### --job-timeout
|
||||
|
||||
| | |
|
||||
| ----------- | ----------------------------------------- |
|
||||
| Type | <code>duration</code> |
|
||||
| Environment | <code>$CODER_SCALETEST_JOB_TIMEOUT</code> |
|
||||
| Default | <code>5m</code> |
|
||||
|
||||
Timeout per job. Jobs may take longer to complete under higher concurrency limits.
|
||||
|
||||
### --output
|
||||
|
||||
| | |
|
||||
| ----------- | ------------------------------------- |
|
||||
| Type | <code>string-array</code> |
|
||||
| Environment | <code>$CODER_SCALETEST_OUTPUTS</code> |
|
||||
| Default | <code>text</code> |
|
||||
|
||||
Output format specs in the format "<format>[:<path>]". Not specifying a path will default to stdout. Available formats: text, json.
|
||||
|
||||
### --tick-interval
|
||||
|
||||
| | |
|
||||
| ----------- | ------------------------------------------------------------- |
|
||||
| Type | <code>duration</code> |
|
||||
| Environment | <code>$CODER_SCALETEST_WORKSPACE_TRAFFIC_TICK_INTERVAL</code> |
|
||||
| Default | <code>100ms</code> |
|
||||
|
||||
How often to send traffic.
|
||||
|
||||
### --timeout
|
||||
|
||||
| | |
|
||||
| ----------- | ------------------------------------- |
|
||||
| Type | <code>duration</code> |
|
||||
| Environment | <code>$CODER_SCALETEST_TIMEOUT</code> |
|
||||
| Default | <code>30m</code> |
|
||||
|
||||
Timeout for the entire test run. 0 means unlimited.
|
||||
|
||||
### --trace
|
||||
|
||||
| | |
|
||||
| ----------- | ----------------------------------- |
|
||||
| Type | <code>bool</code> |
|
||||
| Environment | <code>$CODER_SCALETEST_TRACE</code> |
|
||||
|
||||
Whether application tracing data is collected. It exports to a backend configured by environment variables. See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md.
|
||||
|
||||
### --trace-coder
|
||||
|
||||
| | |
|
||||
| ----------- | ----------------------------------------- |
|
||||
| Type | <code>bool</code> |
|
||||
| Environment | <code>$CODER_SCALETEST_TRACE_CODER</code> |
|
||||
|
||||
Whether opentelemetry traces are sent to Coder. We recommend keeping this disabled unless we advise you to enable it.
|
||||
|
||||
### --trace-honeycomb-api-key
|
||||
|
||||
| | |
|
||||
| ----------- | ----------------------------------------------------- |
|
||||
| Type | <code>string</code> |
|
||||
| Environment | <code>$CODER_SCALETEST_TRACE_HONEYCOMB_API_KEY</code> |
|
||||
|
||||
Enables trace exporting to Honeycomb.io using the provided API key.
|
||||
|
||||
### --trace-propagate
|
||||
|
||||
| | |
|
||||
| ----------- | --------------------------------------------- |
|
||||
| Type | <code>bool</code> |
|
||||
| Environment | <code>$CODER_SCALETEST_TRACE_PROPAGATE</code> |
|
||||
|
||||
Enables trace propagation to the Coder backend, which will be used to correlate server-side spans with client-side spans. Only enable this if the server is configured with the exact same tracing configuration as the client.
|
||||
Reference in New Issue
Block a user