Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
3b721630
Commit
3b721630
authored
8 years ago
by
Craig Tiller
Browse files
Options
Downloads
Patches
Plain Diff
Clamp warmup time in seconds
parent
47f6dc73
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/cpp/microbenchmarks/bm_fullstack_trickle.cc
+8
-0
8 additions, 0 deletions
test/cpp/microbenchmarks/bm_fullstack_trickle.cc
with
8 additions
and
0 deletions
test/cpp/microbenchmarks/bm_fullstack_trickle.cc
+
8
−
0
View file @
3b721630
...
@@ -54,6 +54,8 @@ DEFINE_int32(
...
@@ -54,6 +54,8 @@ DEFINE_int32(
DEFINE_int32
(
DEFINE_int32
(
warmup_iterations
,
100
,
warmup_iterations
,
100
,
"Number of megabytes to pump before collecting flow control stats"
);
"Number of megabytes to pump before collecting flow control stats"
);
DEFINE_int32
(
warmup_max_time_seconds
,
10
,
"Maximum number of seconds to run warmup loop"
);
namespace
grpc
{
namespace
grpc
{
namespace
testing
{
namespace
testing
{
...
@@ -283,11 +285,17 @@ static void BM_PumpStreamServerToClient_Trickle(benchmark::State& state) {
...
@@ -283,11 +285,17 @@ static void BM_PumpStreamServerToClient_Trickle(benchmark::State& state) {
}
}
}
}
};
};
gpr_timespec
warmup_start
=
gpr_now
(
GPR_CLOCK_MONOTONIC
);
for
(
int
i
=
0
;
for
(
int
i
=
0
;
i
<
GPR_MAX
(
FLAGS_warmup_iterations
,
FLAGS_warmup_megabytes
*
1024
*
i
<
GPR_MAX
(
FLAGS_warmup_iterations
,
FLAGS_warmup_megabytes
*
1024
*
1024
/
(
14
+
state
.
range
(
0
)));
1024
/
(
14
+
state
.
range
(
0
)));
i
++
)
{
i
++
)
{
inner_loop
(
true
);
inner_loop
(
true
);
if
(
gpr_time_cmp
(
gpr_time_sub
(
gpr_now
(
GPR_CLOCK_MONOTONIC
),
warmup_start
),
gpr_time_from_seconds
(
FLAGS_warmup_max_time_seconds
,
GPR_TIMESPAN
))
>
0
)
{
break
;
}
}
}
while
(
state
.
KeepRunning
())
{
while
(
state
.
KeepRunning
())
{
inner_loop
(
false
);
inner_loop
(
false
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment