aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/performance
diff options
context:
space:
mode:
authorGravatar Michael Lumish <mlumish@google.com>2018-08-16 09:39:09 -0700
committerGravatar GitHub <noreply@github.com>2018-08-16 09:39:09 -0700
commit44f1270649e87319ae697d26c8697e08905481fc (patch)
treefe2ebafeda8de7ce16fa8a3deecabdb38a21d294 /tools/run_tests/performance
parent04bbe6483f19b2bdb45f5cda03a2e5009e7a1426 (diff)
parentfc566ddcc552e5019d914973cea3eba069f410ed (diff)
Merge pull request #15175 from murgatroid99/node_perf_tests_again
Add Node perf tests for both implementations
Diffstat (limited to 'tools/run_tests/performance')
-rwxr-xr-xtools/run_tests/performance/build_performance.sh3
-rwxr-xr-xtools/run_tests/performance/build_performance_node.sh28
-rwxr-xr-xtools/run_tests/performance/run_worker_node.sh32
-rw-r--r--tools/run_tests/performance/scenario_config.py102
4 files changed, 165 insertions, 0 deletions
diff --git a/tools/run_tests/performance/build_performance.sh b/tools/run_tests/performance/build_performance.sh
index 22e0ca9fa0..35d9e90598 100755
--- a/tools/run_tests/performance/build_performance.sh
+++ b/tools/run_tests/performance/build_performance.sh
@@ -55,6 +55,9 @@ do
"csharp")
python tools/run_tests/run_tests.py -l "$language" -c "$CONFIG" --build_only -j 8 --compiler coreclr
;;
+ "node"|"node_purejs")
+ tools/run_tests/performance/build_performance_node.sh
+ ;;
*)
python tools/run_tests/run_tests.py -l "$language" -c "$CONFIG" --build_only -j 8
;;
diff --git a/tools/run_tests/performance/build_performance_node.sh b/tools/run_tests/performance/build_performance_node.sh
new file mode 100755
index 0000000000..12e0872264
--- /dev/null
+++ b/tools/run_tests/performance/build_performance_node.sh
@@ -0,0 +1,28 @@
+#!/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
+
+. "$HOME/.nvm/nvm.sh"
+
+nvm install 10
+
+set -ex
+
+cd "$(dirname "$0")/../../../../grpc-node"
+
+npm install
+
+./node_modules/.bin/gulp setup
diff --git a/tools/run_tests/performance/run_worker_node.sh b/tools/run_tests/performance/run_worker_node.sh
new file mode 100755
index 0000000000..3e5dd18edb
--- /dev/null
+++ b/tools/run_tests/performance/run_worker_node.sh
@@ -0,0 +1,32 @@
+#!/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.
+
+. "$HOME/.nvm/nvm.sh"
+
+nvm use 10
+
+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" test/performance/worker.js "$@"
diff --git a/tools/run_tests/performance/scenario_config.py b/tools/run_tests/performance/scenario_config.py
index f05753154e..2e78bd07fb 100644
--- a/tools/run_tests/performance/scenario_config.py
+++ b/tools/run_tests/performance/scenario_config.py
@@ -1151,6 +1151,106 @@ class GoLanguage:
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,
+ '--benchmark_impl=grpc'
+ ]
+
+ 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' %
+ (node_implementation, secstr),
+ 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' %
+ (node_implementation, secstr),
+ 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' %
+ (node_implementation, secstr),
+ 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' %
+ (node_implementation, secstr),
+ 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' %
+ (node_implementation, secstr),
+ 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' %
+ (node_implementation, secstr),
+ 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(),
'csharp': CSharpLanguage(),
@@ -1160,4 +1260,6 @@ LANGUAGES = {
'java': JavaLanguage(),
'python': PythonLanguage(),
'go': GoLanguage(),
+ 'node': NodeLanguage(),
+ 'node_purejs': NodeLanguage(node_purejs=True)
}