MCPcopy Index your code
hub / github.com/coder/coder / scaletestCreateWorkspaces

Method scaletestCreateWorkspaces

cli/exp_scaletest.go:807–1146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

805}
806
807func (r *RootCmd) scaletestCreateWorkspaces() *serpent.Command {
808 var (
809 count int64
810 retry int64
811 maxFailures int64
812 template string
813
814 noCleanup bool
815 // TODO: implement this flag
816 // noCleanupFailures bool
817 noWaitForAgents bool
818
819 runCommand string
820 runTimeout time.Duration
821 runExpectTimeout bool
822 runExpectOutput string
823 runLogOutput bool
824
825 // TODO: customizable agent, currently defaults to the first agent found
826 // if there are multiple
827 connectURL string // http://localhost:4/
828 connectMode string // derp or direct
829 connectHold time.Duration
830 connectInterval time.Duration
831 connectTimeout time.Duration
832
833 useHostUser bool
834
835 parameterFlags workspaceParameterFlags
836
837 tracingFlags = &scaletestTracingFlags{}
838 strategy = &scaletestStrategyFlags{}
839 cleanupStrategy = newScaletestCleanupStrategy()
840 output = &scaletestOutputFlags{}
841 )
842
843 cmd := &serpent.Command{
844 Use: "create-workspaces",
845 Short: "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.",
846 Long: `It is recommended that all rate limits are disabled on the server before running this scaletest. This test generates many login events which will be rate limited against the (most likely single) IP.`,
847 Handler: func(inv *serpent.Invocation) error {
848 client, err := r.InitClient(inv)
849 if err != nil {
850 return err
851 }
852
853 ctx := inv.Context()
854
855 me, err := RequireAdmin(ctx, client)
856 if err != nil {
857 return err
858 }
859
860 if count <= 0 {
861 return xerrors.Errorf("--count is required and must be greater than 0")
862 }
863 outputs, err := output.parse()
864 if err != nil {

Callers 1

scaletestCmdMethod · 0.95

Calls 15

InitClientMethod · 0.95
ValidateMethod · 0.95
AddRunMethod · 0.95
RunMethod · 0.95
ResultsMethod · 0.95
CleanupMethod · 0.95
NewTestHarnessFunction · 0.92
DurationTypeAlias · 0.92
ConnectionModeTypeAlias · 0.92
DupClientCopyingHeadersFunction · 0.92
NewRunnerFunction · 0.92

Tested by

no test coverage detected