Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf431b8f

Browse files
committed
cleanup
1 parent30cfbe3 commitf431b8f

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

‎scaletest/workspaceupdates/config.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
typeConfigstruct {
15-
// User is the configuration for the user to create or use.
15+
// User is the configuration for the user to create.
1616
User createusers.Config`json:"user"`
1717

1818
// Workspace is the configuration for the workspace to create. The workspace

‎scaletest/workspaceupdates/metrics.go‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package workspaceupdates
22

33
import (
44
"strconv"
5-
"sync/atomic"
65
"time"
76

87
"github.com/prometheus/client_golang/prometheus"
@@ -11,8 +10,6 @@ import (
1110
typeMetricsstruct {
1211
WorkspaceUpdatesLatencySeconds prometheus.HistogramVec
1312
WorkspaceUpdatesErrorsTotal prometheus.CounterVec
14-
15-
numErrors atomic.Int64
1613
}
1714

1815
funcNewMetrics(reg prometheus.Registerer)*Metrics {
@@ -41,6 +38,5 @@ func (m *Metrics) RecordCompletion(elapsed time.Duration, username string, owned
4138
}
4239

4340
func (m*Metrics)AddError(usernamestring,ownedWorkspacesint64,actionstring) {
44-
m.numErrors.Add(1)
4541
m.WorkspaceUpdatesErrorsTotal.WithLabelValues(username,strconv.Itoa(int(ownedWorkspaces)),action).Inc()
4642
}

‎scaletest/workspaceupdates/run.go‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,23 +71,23 @@ func (r *Runner) Run(ctx context.Context, id string, logs io.Writer) error {
7171
r.client.SetLogBodies(true)
7272

7373
r.createUserRunner=createusers.NewRunner(r.client,r.cfg.User)
74-
newUser,err:=r.createUserRunner.RunReturningUser(ctx,id,logs)
74+
newUserAndToken,err:=r.createUserRunner.RunReturningUser(ctx,id,logs)
7575
iferr!=nil {
7676
returnxerrors.Errorf("create user: %w",err)
7777
}
78-
user:=newUser.User
79-
client:=codersdk.New(r.client.URL,
80-
codersdk.WithSessionToken(newUser.SessionToken),
78+
newUser:=newUserAndToken.User
79+
newUserClient:=codersdk.New(r.client.URL,
80+
codersdk.WithSessionToken(newUserAndToken.SessionToken),
8181
codersdk.WithLogger(logger),
8282
codersdk.WithLogBodies())
8383

84-
logger.Info(ctx,fmt.Sprintf("user %q created",user.Username),slog.F("id",user.ID.String()))
84+
logger.Info(ctx,fmt.Sprintf("user %q created",newUser.Username),slog.F("id",newUser.ID.String()))
8585

8686
dialCtx,cancel:=context.WithTimeout(ctx,r.cfg.DialTimeout)
8787
defercancel()
8888

8989
logger.Info(ctx,"connecting to workspace updates stream")
90-
clients,err:=r.dialTailnet(dialCtx,client,user,logger)
90+
clients,err:=r.dialTailnet(dialCtx,newUserClient,newUser,logger)
9191
iferr!=nil {
9292
returnxerrors.Errorf("tailnet dial failed: %w",err)
9393
}
@@ -99,7 +99,7 @@ func (r *Runner) Run(ctx context.Context, id string, logs io.Writer) error {
9999

100100
completionCh:=make(chanerror,1)
101101
gofunc() {
102-
completionCh<-r.watchWorkspaceUpdates(watchCtx,clients,user,logger)
102+
completionCh<-r.watchWorkspaceUpdates(watchCtx,clients,newUser,logger)
103103
}()
104104

105105
reachedBarrier=true
@@ -114,10 +114,10 @@ func (r *Runner) Run(ctx context.Context, id string, logs io.Writer) error {
114114
}
115115
workspaceBuildConfig:=r.cfg.Workspace
116116
workspaceBuildConfig.OrganizationID=r.cfg.User.OrganizationID
117-
workspaceBuildConfig.UserID=user.ID.String()
117+
workspaceBuildConfig.UserID=newUser.ID.String()
118118
workspaceBuildConfig.Request.Name=workspaceName
119119

120-
runner:=workspacebuild.NewRunner(client,workspaceBuildConfig)
120+
runner:=workspacebuild.NewRunner(newUserClient,workspaceBuildConfig)
121121
r.workspacebuildRunners=append(r.workspacebuildRunners,runner)
122122

123123
logger.Info(ctx,fmt.Sprintf("creating workspace %d/%d",i+1,r.cfg.WorkspaceCount))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp