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
b9de09f2
Commit
b9de09f2
authored
10 years ago
by
Craig Tiller
Browse files
Options
Downloads
Patches
Plain Diff
Allow specifying warmup, benchmark times
parent
fb0edb86
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/cpp/qps/driver.cc
+5
-3
5 additions, 3 deletions
test/cpp/qps/driver.cc
test/cpp/qps/driver.h
+4
-1
4 additions, 1 deletion
test/cpp/qps/driver.h
test/cpp/qps/qps_driver.cc
+6
-2
6 additions, 2 deletions
test/cpp/qps/qps_driver.cc
with
15 additions
and
6 deletions
test/cpp/qps/driver.cc
+
5
−
3
View file @
b9de09f2
...
...
@@ -74,7 +74,9 @@ static vector<string> get_hosts(const string& name) {
ScenarioResult
RunScenario
(
const
ClientConfig
&
initial_client_config
,
size_t
num_clients
,
const
ServerConfig
&
server_config
,
size_t
num_servers
)
{
size_t
num_servers
,
int
warmup_seconds
,
int
benchmark_seconds
)
{
// ClientContext allocator (all are destroyed at scope exit)
list
<
ClientContext
>
contexts
;
auto
alloc_context
=
[
&
contexts
]()
{
...
...
@@ -146,7 +148,7 @@ ScenarioResult RunScenario(const ClientConfig& initial_client_config,
// Let everything warmup
gpr_log
(
GPR_INFO
,
"Warming up"
);
gpr_timespec
start
=
gpr_now
();
gpr_sleep_until
(
gpr_time_add
(
start
,
gpr_time_from_seconds
(
5
)));
gpr_sleep_until
(
gpr_time_add
(
start
,
gpr_time_from_seconds
(
warmup_seconds
)));
// Start a run
gpr_log
(
GPR_INFO
,
"Starting"
);
...
...
@@ -171,7 +173,7 @@ ScenarioResult RunScenario(const ClientConfig& initial_client_config,
// Wait some time
gpr_log
(
GPR_INFO
,
"Running"
);
gpr_sleep_until
(
gpr_time_add
(
start
,
gpr_time_from_seconds
(
15
)));
gpr_sleep_until
(
gpr_time_add
(
start
,
gpr_time_from_seconds
(
benchmark_seconds
)));
// Finish a run
ScenarioResult
result
;
...
...
This diff is collapsed.
Click to expand it.
test/cpp/qps/driver.h
+
4
−
1
View file @
b9de09f2
...
...
@@ -54,7 +54,10 @@ struct ScenarioResult {
ScenarioResult
RunScenario
(
const
grpc
::
testing
::
ClientConfig
&
client_config
,
size_t
num_clients
,
const
grpc
::
testing
::
ServerConfig
&
server_config
,
size_t
num_servers
);
size_t
num_servers
,
int
warmup_seconds
,
int
benchmark_seconds
);
}
// namespace testing
}
// namespace grpc
...
...
This diff is collapsed.
Click to expand it.
test/cpp/qps/qps_driver.cc
+
6
−
2
View file @
b9de09f2
...
...
@@ -40,6 +40,9 @@
DEFINE_int32
(
num_clients
,
1
,
"Number of client binaries"
);
DEFINE_int32
(
num_servers
,
1
,
"Number of server binaries"
);
DEFINE_int32
(
warmup_seconds
,
5
,
"Warmup time (in seconds)"
);
DEFINE_int32
(
benchmark_seconds
,
30
,
"Benchmark time (in seconds)"
);
// Common config
DEFINE_bool
(
enable_ssl
,
false
,
"Use SSL"
);
DEFINE_string
(
rpc_type
,
"UNARY"
,
"Type of RPC: UNARY or STREAMING"
);
...
...
@@ -98,8 +101,9 @@ int main(int argc, char** argv) {
server_config
.
set_threads
(
FLAGS_server_threads
);
server_config
.
set_enable_ssl
(
FLAGS_enable_ssl
);
auto
result
=
RunScenario
(
client_config
,
FLAGS_num_clients
,
server_config
,
FLAGS_num_servers
);
auto
result
=
RunScenario
(
client_config
,
FLAGS_num_clients
,
server_config
,
FLAGS_num_servers
,
FLAGS_warmup_seconds
,
FLAGS_benchmark_seconds
);
gpr_log
(
GPR_INFO
,
"QPS: %.1f"
,
result
.
latencies
.
Count
()
/
...
...
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