Add Node perf tests for both implementations

pull/15175/head
murgatroid99 7 years ago
parent b3069b095d
commit 215b6555c1
  1. 2
      tools/run_tests/performance/build_performance.sh
  2. 26
      tools/run_tests/performance/build_performance_node.sh
  3. 30
      tools/run_tests/performance/run_worker_node.sh
  4. 97
      tools/run_tests/performance/scenario_config.py

@ -58,5 +58,7 @@ do
*)
python tools/run_tests/run_tests.py -l "$language" -c "$CONFIG" --build_only -j 8
;;
"node")
tools/run_tests/performance/build_performance_node.sh
esac
done

@ -0,0 +1,26 @@
#!/bin/bash
# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set +ex
nvm install 9
set -ex
cd "$(dirname "$0")/../../../../grpc-node"
npm install
./node_modules/.bin/gulp setup

@ -0,0 +1,30 @@
#!/bin/bash
# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
nvm use 9
set -ex
fixture=$1
shift
# Enter repo root
cd "$(dirname "$0")/../../.."
# Enter the grpc-node repo root (expected to be next to grpc repo root)
cd ../grpc-node
node -r test/fixtures/$fixture.js tools/run_tests/performance/worker.js $@

@ -1150,6 +1150,101 @@ class GoLanguage:
def __str__(self):
return 'go'
class NodeLanguage:
def __init__(self, node_purejs=False):
pass
self.node_purejs = node_purejs
self.safename = str(self)
def worker_cmdline(self):
fixture = 'native_js' if self.node_purejs else 'native_native'
return ['tools/run_tests/performance/run_worker_node.sh', fixture]
def worker_port_offset(self):
if self.node_purejs:
return 1100
return 1000
def scenarios(self):
node_implementation = 'node_purejs' if self.node_purejs else 'node'
for secure in [True, False]:
secstr = 'secure' if secure else 'insecure'
smoketest_categories = ([SMOKETEST] if secure else []) + [SCALABLE]
yield _ping_pong_scenario(
'%s_to_node_generic_async_streaming_ping_pong_%s' %
(secstr, node_implementation),
rpc_type='STREAMING',
client_type='ASYNC_CLIENT',
server_type='ASYNC_GENERIC_SERVER',
server_language='node',
use_generic_payload=True,
async_server_threads=1,
secure=secure,
categories=smoketest_categories)
yield _ping_pong_scenario(
'%s_to_node_protobuf_async_streaming_ping_pong_%s' %
(secstr, node_implementation),
rpc_type='STREAMING',
client_type='ASYNC_CLIENT',
server_type='ASYNC_SERVER',
server_language='node',
async_server_threads=1,
secure=secure)
yield _ping_pong_scenario(
'%s_to_node_protobuf_async_unary_ping_pong_%s' %
(secstr, node_implementation),
rpc_type='UNARY',
client_type='ASYNC_CLIENT',
server_type='ASYNC_SERVER',
server_language='node',
async_server_threads=1,
secure=secure,
categories=smoketest_categories)
yield _ping_pong_scenario(
'%s_to_node_protobuf_async_unary_qps_unconstrained_%s' %
(secstr, node_implementation),
rpc_type='UNARY',
client_type='ASYNC_CLIENT',
server_type='ASYNC_SERVER',
server_language='node',
unconstrained_client='async',
secure=secure,
categories=smoketest_categories + [SCALABLE])
yield _ping_pong_scenario(
'%s_to_node_protobuf_async_streaming_qps_unconstrained_%s' %
(secstr, node_implementation),
rpc_type='STREAMING',
client_type='ASYNC_CLIENT',
server_type='ASYNC_SERVER',
server_language='node',
unconstrained_client='async',
secure=secure,
categories=[SCALABLE])
yield _ping_pong_scenario(
'%s_to_node_generic_async_streaming_qps_unconstrained_%s' %
(secstr, node_implementation),
rpc_type='STREAMING',
client_type='ASYNC_CLIENT',
server_type='ASYNC_GENERIC_SERVER',
server_language='node',
unconstrained_client='async',
use_generic_payload=True,
secure=secure,
categories=[SCALABLE])
# TODO(murgatroid99): add scenarios node vs C++
def __str__(self):
if self.node_purejs:
return 'node_purejs'
return 'node'
LANGUAGES = {
'c++': CXXLanguage(),
@ -1160,4 +1255,6 @@ LANGUAGES = {
'java': JavaLanguage(),
'python': PythonLanguage(),
'go': GoLanguage(),
'node': NodeLanguage(),
'node_purejs': NodeLanguage(node_purejs=True)
}

Loading…
Cancel
Save