MCPcopy Create free account
hub / github.com/coder/coder / GenerateWorkspaceName

Function GenerateWorkspaceName

scaletest/loadtestutil/names.go:36–43  ·  view source on GitHub ↗

GenerateWorkspaceName generates a workspace name for scale testing. The workspace name follows the pattern: scaletest- -

(id string)

Source from the content-addressed store, hash-verified

34// GenerateWorkspaceName generates a workspace name for scale testing.
35// The workspace name follows the pattern: scaletest-<random>-<id>
36func GenerateWorkspaceName(id string) (name string, err error) {
37 randStr, err := cryptorand.String(DefaultRandLength)
38 if err != nil {
39 return "", err
40 }
41
42 return fmt.Sprintf("%s-%s-%s", ScaleTestPrefix, randStr, id), nil
43}
44
45// GenerateDeterministicWorkspaceName generates a deterministic workspace name
46// for scale testing without a random component. This is useful when the

Callers 2

RunReturningWorkspaceMethod · 0.92
RunMethod · 0.92

Calls 1

StringFunction · 0.92

Tested by

no test coverage detected