Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mogo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
mogo
Commits
fcc1a079
Commit
fcc1a079
authored
May 13, 2024
by
luxq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update test
parent
96b623d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
workerinfo_test.go
db/workerinfo_test.go
+4
-4
No files found.
db/workerinfo_test.go
View file @
fcc1a079
...
@@ -473,11 +473,11 @@ func BenchmarkDbWorkerRunning_FindWorkerByModelId(b *testing.B) {
...
@@ -473,11 +473,11 @@ func BenchmarkDbWorkerRunning_FindWorkerByModelId(b *testing.B) {
defer
db
.
client
.
Disconnect
(
context
.
Background
())
defer
db
.
client
.
Disconnect
(
context
.
Background
())
b
.
ResetTimer
()
b
.
ResetTimer
()
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
modelId
:=
getRandIdInt
(
100
)
modelId
:=
getRandIdInt
(
maxModelId
)
if
w
,
err
:=
db
.
FindWorkerByModelId
(
context
.
Background
(),
modelId
,
10
);
err
!=
nil
{
if
w
,
err
:=
db
.
FindWorkerByModelId
(
context
.
Background
(),
modelId
,
10
);
err
!=
nil
{
panic
(
fmt
.
Sprintf
(
"find worker failed with err:%s"
,
err
))
panic
(
fmt
.
Sprintf
(
"find worker failed with err:%s"
,
err
))
}
else
if
len
(
w
)
==
0
{
}
else
if
len
(
w
)
==
0
{
b
.
Logf
(
"FindWorkerByModelId find %d with id %
s
\n
"
,
len
(
w
),
modelId
)
b
.
Logf
(
"FindWorkerByModelId find %d with id %
d
\n
"
,
len
(
w
),
modelId
)
}
}
}
}
}
}
...
@@ -491,11 +491,11 @@ func BenchmarkDbWorkerRunning_FindWorkerByModelId_Parallel(b *testing.B) {
...
@@ -491,11 +491,11 @@ func BenchmarkDbWorkerRunning_FindWorkerByModelId_Parallel(b *testing.B) {
defer
db
.
client
.
Disconnect
(
context
.
Background
())
defer
db
.
client
.
Disconnect
(
context
.
Background
())
b
.
RunParallel
(
func
(
pb
*
testing
.
PB
)
{
b
.
RunParallel
(
func
(
pb
*
testing
.
PB
)
{
for
pb
.
Next
()
{
for
pb
.
Next
()
{
modelId
:=
getRandIdInt
(
100
)
modelId
:=
getRandIdInt
(
maxModelId
)
if
w
,
err
:=
db
.
FindWorkerByModelId
(
context
.
Background
(),
modelId
,
10
);
err
!=
nil
{
if
w
,
err
:=
db
.
FindWorkerByModelId
(
context
.
Background
(),
modelId
,
10
);
err
!=
nil
{
panic
(
fmt
.
Sprintf
(
"find worker failed with err:%s"
,
err
))
panic
(
fmt
.
Sprintf
(
"find worker failed with err:%s"
,
err
))
}
else
if
len
(
w
)
==
0
{
}
else
if
len
(
w
)
==
0
{
b
.
Logf
(
"FindWorkerByModelId find %d with id %
s
\n
"
,
len
(
w
),
modelId
)
b
.
Logf
(
"FindWorkerByModelId find %d with id %
d
\n
"
,
len
(
w
),
modelId
)
}
}
}
}
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment