Merge pull request #11286 from murgatroid99/node_perf_tests

Enable more Node performance tests, fix streaming test implementation
pull/11387/head
Michael Lumish 8 years ago committed by GitHub
commit 0fee7226cc
  1. 42
      src/node/performance/benchmark_client.js
  2. 44
      tools/run_tests/performance/scenario_config.py

@ -227,18 +227,22 @@ BenchmarkClient.prototype.startClosedLoop = function(
makeCall = function(client) { makeCall = function(client) {
if (self.running) { if (self.running) {
self.pending_calls++; self.pending_calls++;
var start_time = process.hrtime();
var call = client.streamingCall(); var call = client.streamingCall();
var start_time = process.hrtime();
call.write(argument); call.write(argument);
call.on('data', function() { call.on('data', function() {
});
call.on('end', function() {
var time_diff = process.hrtime(start_time); var time_diff = process.hrtime(start_time);
self.histogram.add(timeDiffToNanos(time_diff)); self.histogram.add(timeDiffToNanos(time_diff));
makeCall(client);
self.pending_calls--; self.pending_calls--;
if ((!self.running) && self.pending_calls == 0) { if (self.running) {
self.emit('finished'); self.pending_calls++;
start_time = process.hrtime();
call.write(argument);
} else {
call.end();
if (self.pending_calls == 0) {
self.emit('finished');
}
} }
}); });
call.on('error', function(error) { call.on('error', function(error) {
@ -317,30 +321,8 @@ BenchmarkClient.prototype.startPoisson = function(
} }
}; };
} else { } else {
makeCall = function(client, poisson) { self.emit('error', new Error('Streaming Poisson benchmarks not supported'));
if (self.running) { return;
self.pending_calls++;
var start_time = process.hrtime();
var call = client.streamingCall();
call.write(argument);
call.on('data', function() {
});
call.on('end', function() {
var time_diff = process.hrtime(start_time);
self.histogram.add(timeDiffToNanos(time_diff));
self.pending_calls--;
if ((!self.running) && self.pending_calls == 0) {
self.emit('finished');
}
});
call.on('error', function(error) {
self.emit('error', new Error('Client error: ' + error.message));
self.running = false;
});
} else {
poisson.stop();
}
};
} }
var averageIntervalMs = (1 / offered_load) * 1000; var averageIntervalMs = (1 / offered_load) * 1000;

@ -523,15 +523,14 @@ class NodeLanguage:
def scenarios(self): def scenarios(self):
# TODO(jtattermusch): make this scenario work # TODO(jtattermusch): make this scenario work
#yield _ping_pong_scenario( yield _ping_pong_scenario(
# 'node_generic_async_streaming_ping_pong', rpc_type='STREAMING', 'node_generic_streaming_ping_pong', rpc_type='STREAMING',
# client_type='ASYNC_CLIENT', server_type='ASYNC_GENERIC_SERVER', client_type='ASYNC_CLIENT', server_type='ASYNC_GENERIC_SERVER',
# use_generic_payload=True) use_generic_payload=True)
# TODO(jtattermusch): make this scenario work yield _ping_pong_scenario(
#yield _ping_pong_scenario( 'node_protobuf_streaming_ping_pong', rpc_type='STREAMING',
# 'node_protobuf_async_streaming_ping_pong', rpc_type='STREAMING', client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER')
# client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER')
yield _ping_pong_scenario( yield _ping_pong_scenario(
'node_protobuf_unary_ping_pong', rpc_type='UNARY', 'node_protobuf_unary_ping_pong', rpc_type='UNARY',
@ -564,29 +563,26 @@ class NodeLanguage:
secure=secure, secure=secure,
categories=[SCALABLE]) categories=[SCALABLE])
# TODO(murgatroid99): fix bugs with this scenario and re-enable it yield _ping_pong_scenario(
# yield _ping_pong_scenario( 'node_protobuf_unary_qps_unconstrained', rpc_type='UNARY',
# 'node_protobuf_async_unary_qps_unconstrained', rpc_type='UNARY', client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
# client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', unconstrained_client='async',
# unconstrained_client='async', categories=[SCALABLE, SMOKETEST])
# categories=[SCALABLE, SMOKETEST])
# TODO(jtattermusch): make this scenario work yield _ping_pong_scenario(
#yield _ping_pong_scenario( 'node_protobuf_streaming_qps_unconstrained', rpc_type='STREAMING',
# 'node_protobuf_async_streaming_qps_unconstrained', rpc_type='STREAMING', client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
# client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', unconstrained_client='async')
# unconstrained_client='async')
yield _ping_pong_scenario( yield _ping_pong_scenario(
'node_to_cpp_protobuf_async_unary_ping_pong', rpc_type='UNARY', 'node_to_cpp_protobuf_async_unary_ping_pong', rpc_type='UNARY',
client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
server_language='c++', async_server_threads=1) server_language='c++', async_server_threads=1)
# TODO(jtattermusch): make this scenario work yield _ping_pong_scenario(
#yield _ping_pong_scenario( 'node_to_cpp_protobuf_async_streaming_ping_pong', rpc_type='STREAMING',
# 'node_to_cpp_protobuf_async_streaming_ping_pong', rpc_type='STREAMING', client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
# client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', server_language='c++', async_server_threads=1)
# server_language='c++', async_server_threads=1)
def __str__(self): def __str__(self):
return 'node' return 'node'

Loading…
Cancel
Save