Improve Node benchmarks, add generic unary test

pull/10416/head
murgatroid99 8 years ago
parent 7e6b7df8d6
commit a1eefcea5f
  1. 8
      src/node/performance/benchmark_server.js
  2. 11
      src/node/performance/generic_service.js
  3. 23
      src/node/performance/worker_service_impl.js
  4. 3
      tools/run_tests/performance/build_performance.sh

@ -88,6 +88,13 @@ function streamingCall(call) {
});
}
function makeUnaryGenericCall(response_size) {
var response = zeroBuffer(response_size);
return function unaryGenericCall(call, callback) {
callback(null, response);
};
}
function makeStreamingGenericCall(response_size) {
var response = zeroBuffer(response_size);
return function streamingGenericCall(call) {
@ -129,6 +136,7 @@ function BenchmarkServer(host, port, tls, generic, response_size) {
this.port = server.bind(host + ':' + port, server_creds);
if (generic) {
server.addService(genericService, {
unaryCall: makeUnaryGenericCall(response_size),
streamingCall: makeStreamingGenericCall(response_size)
});
} else {

@ -34,8 +34,17 @@
var _ = require('lodash');
module.exports = {
'unaryCall' : {
path: '/grpc.testing.BenchmarkService/UnaryCall',
requestStream: false,
responseStream: false,
requestSerialize: _.identity,
requestDeserialize: _.identity,
responseSerialize: _.identity,
responseDeserialize: _.identity
},
'streamingCall' : {
path: '/grpc.testing/BenchmarkService',
path: '/grpc.testing.BenchmarkService/StreamingCall',
requestStream: true,
responseStream: true,
requestSerialize: _.identity,

@ -89,6 +89,7 @@ module.exports = function WorkerServiceImpl(benchmark_impl, server) {
default:
call.emit('error', new Error('Unsupported PayloadConfig type' +
setup.payload_config.payload));
return;
}
switch (setup.load_params.load) {
case 'closed_loop':
@ -103,6 +104,7 @@ module.exports = function WorkerServiceImpl(benchmark_impl, server) {
default:
call.emit('error', new Error('Unsupported LoadParams type' +
setup.load_params.load));
return;
}
stats = client.mark();
call.write({
@ -137,8 +139,27 @@ module.exports = function WorkerServiceImpl(benchmark_impl, server) {
switch (request.argtype) {
case 'setup':
console.log('ServerConfig %j', request.setup);
var setup = request.setup;
var resp_size, generic;
if (setup.payload_config) {
switch (setup.payload_config.payload) {
case 'bytebuf_params':
resp_size = setup.payload_config.bytebuf_params.resp_size;
generic = true;
break;
case 'simple_params':
resp_size = setup.payload_config.simple_params.resp_size;
generic = false;
break;
default:
call.emit('error', new Error('Unsupported PayloadConfig type' +
setup.payload_config.payload));
return;
}
}
server = new BenchmarkServer('[::]', request.setup.port,
request.setup.security_params);
request.setup.security_params,
generic, resp_size);
server.on('started', function() {
stats = server.mark();
call.write({

@ -61,6 +61,9 @@ do
"csharp")
python tools/run_tests/run_tests.py -l $language -c $CONFIG --build_only -j 8 --compiler coreclr
;;
"node")
python tools/run_tests/run_tests.py -l $language -c $CONFIG --build_only -j 8 --iomgr_platform=uv
;;
*)
python tools/run_tests/run_tests.py -l $language -c $CONFIG --build_only -j 8
;;

Loading…
Cancel
Save