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

Commitf81db2f

Browse files
committed
remove barrier
1 parentc697a9d commitf81db2f

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

‎cli/exp_scaletest.go‎

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@ import (
3333
"github.com/coder/coder/v2/codersdk"
3434
"github.com/coder/coder/v2/codersdk/workspacesdk"
3535
"github.com/coder/coder/v2/scaletest/agentconn"
36-
"github.com/coder/coder/v2/scaletest/coderconnect"
36+
"github.com/coder/coder/v2/scaletest/createusers"
3737
"github.com/coder/coder/v2/scaletest/createworkspaces"
3838
"github.com/coder/coder/v2/scaletest/dashboard"
3939
"github.com/coder/coder/v2/scaletest/harness"
4040
"github.com/coder/coder/v2/scaletest/loadtestutil"
4141
"github.com/coder/coder/v2/scaletest/reconnectingpty"
4242
"github.com/coder/coder/v2/scaletest/workspacebuild"
4343
"github.com/coder/coder/v2/scaletest/workspacetraffic"
44+
"github.com/coder/coder/v2/scaletest/workspaceupdates"
4445
"github.com/coder/serpent"
4546
)
4647

@@ -57,7 +58,7 @@ func (r *RootCmd) scaletestCmd() *serpent.Command {
5758
r.scaletestCleanup(),
5859
r.scaletestDashboard(),
5960
r.scaletestCreateWorkspaces(),
60-
r.scaletestCoderConnect(),
61+
r.scaletestWorkspaceUpdates(),
6162
r.scaletestWorkspaceTraffic(),
6263
},
6364
}
@@ -856,7 +857,7 @@ func (r *RootCmd) scaletestCreateWorkspaces() *serpent.Command {
856857
returncmd
857858
}
858859

859-
func (r*RootCmd)scaletestCoderConnect()*serpent.Command {
860+
func (r*RootCmd)scaletestWorkspaceUpdates()*serpent.Command {
860861
var (
861862
workspaceCountint64
862863
powerUserWorkspacesint64
@@ -877,8 +878,8 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
877878
)
878879

879880
cmd:=&serpent.Command{
880-
Use:"coder-connect",
881-
Short:"Simulate the load of Coder Desktop clients",
881+
Use:"workspace-updates",
882+
Short:"Simulate the load of Coder Desktop clients receiving workspace updates",
882883
Handler:func(inv*serpent.Invocation)error {
883884
ctx:=inv.Context()
884885
client,err:=r.TryInitClient(inv)
@@ -963,7 +964,7 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
963964
tracer:=tracerProvider.Tracer(scaletestTracerName)
964965

965966
reg:=prometheus.NewRegistry()
966-
metrics:=coderconnect.NewMetrics(reg)
967+
metrics:=workspaceupdates.NewMetrics(reg)
967968

968969
logger:=inv.Logger
969970
prometheusSrvClose:=ServeHandler(ctx,logger,promhttp.HandlerFor(reg, promhttp.HandlerOpts{}),prometheusFlags.Address,"prometheus")
@@ -981,13 +982,14 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
981982

982983
_,_=fmt.Fprintln(inv.Stderr,"Creating users...")
983984

984-
dialBarrier:=harness.NewBarrier(int(powerUserCount+regularUserCount))
985+
dialBarrier:=new(sync.WaitGroup)
986+
dialBarrier.Add(int(powerUserCount+regularUserCount))
985987

986-
configs:=make([]coderconnect.Config,0,powerUserCount+regularUserCount)
988+
configs:=make([]workspaceupdates.Config,0,powerUserCount+regularUserCount)
987989

988990
fori:=int64(0);i<powerUserCount;i++ {
989-
config:=coderconnect.Config{
990-
User:coderconnect.UserConfig{
991+
config:=workspaceupdates.Config{
992+
User:createusers.Config{
991993
OrganizationID:me.OrganizationIDs[0],
992994
},
993995
Workspace: workspacebuild.Config{
@@ -1002,7 +1004,6 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
10021004
WorkspaceUpdatesTimeout:workspaceUpdatesTimeout,
10031005
DialTimeout:dialTimeout,
10041006
Metrics:metrics,
1005-
NoCleanup:noCleanup,
10061007
DialBarrier:dialBarrier,
10071008
}
10081009
iferr:=config.Validate();err!=nil {
@@ -1013,8 +1014,8 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
10131014

10141015
fori:=int64(0);i<regularUserCount;i++ {
10151016
workspaceCount:=1
1016-
config:=coderconnect.Config{
1017-
User:coderconnect.UserConfig{
1017+
config:=workspaceupdates.Config{
1018+
User:createusers.Config{
10181019
OrganizationID:me.OrganizationIDs[0],
10191020
},
10201021
Workspace: workspacebuild.Config{
@@ -1029,7 +1030,6 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
10291030
WorkspaceUpdatesTimeout:workspaceUpdatesTimeout,
10301031
DialTimeout:dialTimeout,
10311032
Metrics:metrics,
1032-
NoCleanup:noCleanup,
10331033
DialBarrier:dialBarrier,
10341034
}
10351035
iferr:=config.Validate();err!=nil {
@@ -1040,7 +1040,7 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
10401040

10411041
th:=harness.NewTestHarness(strategy.toStrategy(),cleanupStrategy.toStrategy())
10421042
fori,config:=rangeconfigs {
1043-
name:=fmt.Sprintf("coderconnect-%dw",config.WorkspaceCount)
1043+
name:=fmt.Sprintf("workspaceupdates-%dw",config.WorkspaceCount)
10441044
id:=strconv.Itoa(i)
10451045
username,email,err:=loadtestutil.GenerateUserIdentifier(id)
10461046
iferr!=nil {
@@ -1049,7 +1049,7 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
10491049
config.User.Username=username
10501050
config.User.Email=email
10511051

1052-
varrunner harness.Runnable=coderconnect.NewRunner(client,config)
1052+
varrunner harness.Runnable=workspaceupdates.NewRunner(client,config)
10531053
iftracingEnabled {
10541054
runner=&runnableTraceWrapper{
10551055
tracer:tracer,
@@ -1061,7 +1061,7 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
10611061
th.AddRun(name,id,runner)
10621062
}
10631063

1064-
_,_=fmt.Fprintln(inv.Stderr,"RunningCoder Connect scaletest...")
1064+
_,_=fmt.Fprintln(inv.Stderr,"Runningworkspace updates scaletest...")
10651065
testCtx,testCancel:=strategy.toContext(ctx)
10661066
defertestCancel()
10671067
err=th.Run(testCtx)
@@ -1082,12 +1082,14 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
10821082
}
10831083
}
10841084

1085-
_,_=fmt.Fprintln(inv.Stderr,"\nCleaning up...")
1086-
cleanupCtx,cleanupCancel:=cleanupStrategy.toContext(ctx)
1087-
defercleanupCancel()
1088-
err=th.Cleanup(cleanupCtx)
1089-
iferr!=nil {
1090-
returnxerrors.Errorf("cleanup tests: %w",err)
1085+
if!noCleanup {
1086+
_,_=fmt.Fprintln(inv.Stderr,"\nCleaning up...")
1087+
cleanupCtx,cleanupCancel:=cleanupStrategy.toContext(ctx)
1088+
defercleanupCancel()
1089+
err=th.Cleanup(cleanupCtx)
1090+
iferr!=nil {
1091+
returnxerrors.Errorf("cleanup tests: %w",err)
1092+
}
10911093
}
10921094

10931095
ifres.TotalFail>0 {
@@ -1131,7 +1133,7 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
11311133
Flag:"dial-timeout",
11321134
Env:"CODER_SCALETEST_DIAL_TIMEOUT",
11331135
Default:"2m",
1134-
Description:"Timeout for dialing theCoder Connect endpoint.",
1136+
Description:"Timeout for dialing thetailnet endpoint.",
11351137
Value:serpent.DurationOf(&dialTimeout),
11361138
},
11371139
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp