diff options
author | ZhouyihaiDing <ddyihai@google.com> | 2017-09-25 23:20:30 +0000 |
---|---|---|
committer | ZhouyihaiDing <ddyihai@google.com> | 2017-09-26 17:23:46 +0000 |
commit | c8e145bd93d3aa0ae02fe8bbddc265f1c35b5339 (patch) | |
tree | deda003ca366f07fdc9ddbfb62d75826ab22da3a /tools/run_tests/performance | |
parent | a1fbca0fa5e3c896a8f250aa1e1ffe2fedeec3a3 (diff) |
add protobuf c_ext to php benchmark
Diffstat (limited to 'tools/run_tests/performance')
-rwxr-xr-x | tools/run_tests/performance/run_worker_php.sh | 11 | ||||
-rw-r--r-- | tools/run_tests/performance/scenario_config.py | 28 |
2 files changed, 36 insertions, 3 deletions
diff --git a/tools/run_tests/performance/run_worker_php.sh b/tools/run_tests/performance/run_worker_php.sh index 5d0c4fa4fd..e524d5286d 100755 --- a/tools/run_tests/performance/run_worker_php.sh +++ b/tools/run_tests/performance/run_worker_php.sh @@ -16,13 +16,18 @@ source ~/.rvm/scripts/rvm set -ex -repo=$(dirname $0)/../../.. - +cd $(dirname $0)/../../.. +repo=$(pwd) # First set up all dependences needed for PHP QPS test cd $repo cd src/php/tests/qps composer install +# Install protobuf C-extension for php +cd vendor/google/protobuf/php/ext/google/protobuf +phpize +./configure +make # The proxy worker for PHP is implemented in Ruby -cd ../../../.. +cd $repo ruby src/ruby/qps/proxy-worker.rb $@ diff --git a/tools/run_tests/performance/scenario_config.py b/tools/run_tests/performance/scenario_config.py index 5efc9f5648..31017f1d85 100644 --- a/tools/run_tests/performance/scenario_config.py +++ b/tools/run_tests/performance/scenario_config.py @@ -827,6 +827,33 @@ class PhpLanguage: return 'php' +class PhpLanguage_ext: + + def __init__(self): + pass + self.safename = str(self) + + def worker_cmdline(self): + return ['tools/run_tests/performance/run_worker_php.sh -c'] + + def worker_port_offset(self): + return 800 + + def scenarios(self): + yield _ping_pong_scenario( + 'php_to_cpp_protobuf_sync_unary_ping_pong', rpc_type='UNARY', + client_type='SYNC_CLIENT', server_type='SYNC_SERVER', + server_language='c++', async_server_threads=1) + + yield _ping_pong_scenario( + 'php_to_cpp_protobuf_sync_streaming_ping_pong', rpc_type='STREAMING', + client_type='SYNC_CLIENT', server_type='SYNC_SERVER', + server_language='c++', async_server_threads=1) + + def __str__(self): + return 'php' + + class JavaLanguage: def __init__(self): @@ -1025,6 +1052,7 @@ LANGUAGES = { 'node_express': NodeExpressLanguage(), 'ruby' : RubyLanguage(), 'php' : PhpLanguage(), + 'php_ext' : PhpLanguage_ext(), 'java' : JavaLanguage(), 'python' : PythonLanguage(), 'go' : GoLanguage(), |