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

Method scaletestTaskStatus

cli/exp_scaletest_taskstatus.go:30–281  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28)
29
30func (r *RootCmd) scaletestTaskStatus() *serpent.Command {
31 var (
32 count int64
33 template string
34 workspaceNamePrefix string
35 appSlug string
36 reportStatusPeriod time.Duration
37 reportStatusDuration time.Duration
38 baselineDuration time.Duration
39 tracingFlags = &scaletestTracingFlags{}
40 prometheusFlags = &scaletestPrometheusFlags{}
41 timeoutStrategy = &timeoutFlags{}
42 cleanupStrategy = newScaletestCleanupStrategy()
43 output = &scaletestOutputFlags{}
44 )
45 orgContext := NewOrganizationContext()
46
47 cmd := &serpent.Command{
48 Use: "task-status",
49 Short: "Generates load on the Coder server by simulating task status reporting",
50 Long: `This test creates external workspaces and simulates AI agents reporting task status.
51After all runners connect, it waits for the baseline duration before triggering status reporting.`,
52 Handler: func(inv *serpent.Invocation) error {
53 ctx := inv.Context()
54
55 outputs, err := output.parse()
56 if err != nil {
57 return xerrors.Errorf("could not parse --output flags: %w", err)
58 }
59
60 client, err := r.InitClient(inv)
61 if err != nil {
62 return err
63 }
64
65 org, err := orgContext.Selected(inv, client)
66 if err != nil {
67 return err
68 }
69
70 _, err = RequireAdmin(ctx, client)
71 if err != nil {
72 return err
73 }
74
75 // Disable rate limits for this test
76 client.HTTPClient = &http.Client{
77 Transport: &codersdk.HeaderTransport{
78 Transport: http.DefaultTransport,
79 Header: map[string][]string{
80 codersdk.BypassRatelimitHeader: {"true"},
81 },
82 },
83 }
84
85 // Find the template
86 tpl, err := parseTemplate(ctx, client, []uuid.UUID{org.ID}, template)
87 if err != nil {

Callers 1

scaletestCmdMethod · 0.95

Calls 15

InitClientMethod · 0.95
SelectedMethod · 0.95
ValidateMethod · 0.95
AddRunMethod · 0.95
RunMethod · 0.95
ResultsMethod · 0.95
CleanupMethod · 0.95
AttachOptionsMethod · 0.95
NewMetricsFunction · 0.92
NewTestHarnessFunction · 0.92
DupClientCopyingHeadersFunction · 0.92
NewRunnerFunction · 0.92

Tested by

no test coverage detected