mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: add --disable-direct to coder exp scaletest workspace-traffic --ssh (#19632)
Relates to https://github.com/coder/internal/issues/888 As part of our renewed connection scaletesting efforts, we want to scaletest coder in a scenario where direct connections aren't available (relatively common for our customers), and all concurrent connections are relayed via DERP. This PR adds a flag, `--disable-direct` that can be included on the existing`coder exp scaletest workspace-traffic -ssh` to disable direct connections.
This commit is contained in:
+18
-9
@@ -864,6 +864,7 @@ func (r *RootCmd) scaletestWorkspaceTraffic() *serpent.Command {
|
||||
tickInterval time.Duration
|
||||
bytesPerTick int64
|
||||
ssh bool
|
||||
disableDirect bool
|
||||
useHostLogin bool
|
||||
app string
|
||||
template string
|
||||
@@ -1023,15 +1024,16 @@ func (r *RootCmd) scaletestWorkspaceTraffic() *serpent.Command {
|
||||
|
||||
// Setup our workspace agent connection.
|
||||
config := workspacetraffic.Config{
|
||||
AgentID: agent.ID,
|
||||
BytesPerTick: bytesPerTick,
|
||||
Duration: strategy.timeout,
|
||||
TickInterval: tickInterval,
|
||||
ReadMetrics: metrics.ReadMetrics(ws.OwnerName, ws.Name, agent.Name),
|
||||
WriteMetrics: metrics.WriteMetrics(ws.OwnerName, ws.Name, agent.Name),
|
||||
SSH: ssh,
|
||||
Echo: ssh,
|
||||
App: appConfig,
|
||||
AgentID: agent.ID,
|
||||
BytesPerTick: bytesPerTick,
|
||||
Duration: strategy.timeout,
|
||||
TickInterval: tickInterval,
|
||||
ReadMetrics: metrics.ReadMetrics(ws.OwnerName, ws.Name, agent.Name),
|
||||
WriteMetrics: metrics.WriteMetrics(ws.OwnerName, ws.Name, agent.Name),
|
||||
SSH: ssh,
|
||||
DisableDirect: disableDirect,
|
||||
Echo: ssh,
|
||||
App: appConfig,
|
||||
}
|
||||
|
||||
if webClient != nil {
|
||||
@@ -1117,6 +1119,13 @@ func (r *RootCmd) scaletestWorkspaceTraffic() *serpent.Command {
|
||||
Description: "Send traffic over SSH, cannot be used with --app.",
|
||||
Value: serpent.BoolOf(&ssh),
|
||||
},
|
||||
{
|
||||
Flag: "disable-direct",
|
||||
Env: "CODER_SCALETEST_WORKSPACE_TRAFFIC_DISABLE_DIRECT_CONNECTIONS",
|
||||
Default: "false",
|
||||
Description: "Disable direct connections for SSH traffic to workspaces. Does nothing if `--ssh` is not also set.",
|
||||
Value: serpent.BoolOf(&disableDirect),
|
||||
},
|
||||
{
|
||||
Flag: "app",
|
||||
Env: "CODER_SCALETEST_WORKSPACE_TRAFFIC_APP",
|
||||
|
||||
Reference in New Issue
Block a user