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
37a907e4
Commit
37a907e4
authored
8 years ago
by
Jan Tattermusch
Browse files
Options
Downloads
Patches
Plain Diff
add support for CLIENT_LANGUAGE setting
parent
9ad288e7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tools/run_tests/performance/scenario_config.py
+10
-0
10 additions, 0 deletions
tools/run_tests/performance/scenario_config.py
tools/run_tests/run_performance_tests.py
+16
-2
16 additions, 2 deletions
tools/run_tests/run_performance_tests.py
with
26 additions
and
2 deletions
tools/run_tests/performance/scenario_config.py
+
10
−
0
View file @
37a907e4
...
...
@@ -81,6 +81,7 @@ def remove_nonproto_fields(scenario):
"""
Remove special-purpose that contains some extra info about the scenario
but don
'
t belong to the ScenarioConfig protobuf message
"""
scenario
.
pop
(
'
CATEGORIES
'
,
None
)
scenario
.
pop
(
'
CLIENT_LANGUAGE
'
,
None
)
scenario
.
pop
(
'
SERVER_LANGUAGE
'
,
None
)
return
scenario
...
...
@@ -90,6 +91,7 @@ def _ping_pong_scenario(name, rpc_type,
secure
=
True
,
use_generic_payload
=
False
,
use_unconstrained_client
=
False
,
client_language
=
None
,
server_language
=
None
,
server_core_limit
=
0
,
async_server_threads
=
0
,
...
...
@@ -142,6 +144,9 @@ def _ping_pong_scenario(name, rpc_type,
scenario
[
'
client_config
'
][
'
client_channels
'
]
=
1
scenario
[
'
client_config
'
][
'
async_client_threads
'
]
=
1
if
client_language
:
# the CLIENT_LANGUAGE field is recognized by run_performance_tests.py
scenario
[
'
CLIENT_LANGUAGE
'
]
=
client_language
if
server_language
:
# the SERVER_LANGUAGE field is recognized by run_performance_tests.py
scenario
[
'
SERVER_LANGUAGE
'
]
=
server_language
...
...
@@ -277,6 +282,11 @@ class CSharpLanguage:
client_type
=
'
ASYNC_CLIENT
'
,
server_type
=
'
ASYNC_SERVER
'
,
server_language
=
'
c++
'
,
server_core_limit
=
1
,
async_server_threads
=
1
)
yield
_ping_pong_scenario
(
'
cpp_to_csharp_protobuf_async_unary_qps_unconstrained
'
,
rpc_type
=
'
UNARY
'
,
client_type
=
'
ASYNC_CLIENT
'
,
server_type
=
'
ASYNC_SERVER
'
,
use_unconstrained_client
=
True
,
client_language
=
'
c++
'
)
def
__str__
(
self
):
return
'
csharp
'
...
...
This diff is collapsed.
Click to expand it.
tools/run_tests/run_performance_tests.py
+
16
−
2
View file @
37a907e4
...
...
@@ -304,7 +304,11 @@ def create_scenarios(languages, workers_by_lang, remote_host=None, regex='.*',
# 'SERVER_LANGUAGE' is an indicator for this script to pick
# a server in different language.
custom_server_lang
=
scenario_json
.
get
(
'
SERVER_LANGUAGE
'
,
None
)
custom_client_lang
=
scenario_json
.
get
(
'
CLIENT_LANGUAGE
'
,
None
)
scenario_json
=
scenario_config
.
remove_nonproto_fields
(
scenario_json
)
if
custom_server_lang
and
custom_client_lang
:
raise
Exception
(
'
Cannot set both custom CLIENT_LANGUAGE and SERVER_LANGUAGE
'
'
in the same scenario
'
)
if
custom_server_lang
:
if
not
workers_by_lang
.
get
(
custom_server_lang
,
[]):
print
'
Warning: Skipping scenario %s as
'
%
scenario_json
[
'
name
'
]
...
...
@@ -314,6 +318,16 @@ def create_scenarios(languages, workers_by_lang, remote_host=None, regex='.*',
for
idx
in
range
(
0
,
scenario_json
[
'
num_servers
'
]):
# replace first X workers by workers of a different language
workers
[
idx
]
=
workers_by_lang
[
custom_server_lang
][
idx
]
if
custom_client_lang
:
if
not
workers_by_lang
.
get
(
custom_client_lang
,
[]):
print
'
Warning: Skipping scenario %s as
'
%
scenario_json
[
'
name
'
]
print
(
'
CLIENT_LANGUAGE is set to %s yet the language has
'
'
not been selected with -l
'
%
custom_client_lang
)
continue
for
idx
in
range
(
scenario_json
[
'
num_servers
'
],
len
(
workers
)):
# replace all client workers by workers of a different language,
# leave num_server workers as they are server workers.
workers
[
idx
]
=
workers_by_lang
[
custom_client_lang
][
idx
]
scenario
=
create_scenario_jobspec
(
scenario_json
,
workers
,
remote_host
=
remote_host
,
...
...
@@ -360,8 +374,8 @@ argp.add_argument('--bq_result_table', default=None, type=str,
help
=
'
Bigquery
"
dataset.table
"
to upload results to.
'
)
argp
.
add_argument
(
'
--category
'
,
choices
=
[
'
smoketest
'
,
'
all
'
],
default
=
'
smoketest
'
,
help
=
'
Select a category of tests to run.
Smoketest runs by default.
'
)
default
=
'
all
'
,
help
=
'
Select a category of tests to run.
'
)
argp
.
add_argument
(
'
--netperf
'
,
default
=
False
,
action
=
'
store_const
'
,
...
...
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