mirror of https://github.com/grpc/grpc.git
commit
bd000af278
40 changed files with 1377 additions and 634 deletions
@ -1,52 +0,0 @@ |
||||
// Copyright 2015, Google Inc. |
||||
// All rights reserved. |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without |
||||
// modification, are permitted provided that the following conditions are |
||||
// met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright |
||||
// notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above |
||||
// copyright notice, this list of conditions and the following disclaimer |
||||
// in the documentation and/or other materials provided with the |
||||
// distribution. |
||||
// * Neither the name of Google Inc. nor the names of its |
||||
// contributors may be used to endorse or promote products derived from |
||||
// this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
// TODO(jtattermusch): switch to proto3 once C# supports that. |
||||
syntax = "proto3"; |
||||
|
||||
package grpc.health.v1alpha; |
||||
option csharp_namespace = "Grpc.Health.V1Alpha"; |
||||
|
||||
message HealthCheckRequest { |
||||
string host = 1; |
||||
string service = 2; |
||||
} |
||||
|
||||
message HealthCheckResponse { |
||||
enum ServingStatus { |
||||
UNKNOWN = 0; |
||||
SERVING = 1; |
||||
NOT_SERVING = 2; |
||||
} |
||||
ServingStatus status = 1; |
||||
} |
||||
|
||||
service Health { |
||||
rpc Check(HealthCheckRequest) returns (HealthCheckResponse); |
||||
} |
@ -1,49 +0,0 @@ |
||||
// Copyright 2015, Google Inc. |
||||
// All rights reserved. |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without |
||||
// modification, are permitted provided that the following conditions are |
||||
// met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright |
||||
// notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above |
||||
// copyright notice, this list of conditions and the following disclaimer |
||||
// in the documentation and/or other materials provided with the |
||||
// distribution. |
||||
// * Neither the name of Google Inc. nor the names of its |
||||
// contributors may be used to endorse or promote products derived from |
||||
// this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
syntax = "proto3"; |
||||
|
||||
package grpc.health.v1alpha; |
||||
|
||||
message HealthCheckRequest { |
||||
string service = 1; |
||||
} |
||||
|
||||
message HealthCheckResponse { |
||||
enum ServingStatus { |
||||
UNKNOWN = 0; |
||||
SERVING = 1; |
||||
NOT_SERVING = 2; |
||||
} |
||||
ServingStatus status = 1; |
||||
} |
||||
|
||||
service Health { |
||||
rpc Check(HealthCheckRequest) returns (HealthCheckResponse); |
||||
} |
@ -0,0 +1,336 @@ |
||||
/* |
||||
* |
||||
* Copyright 2015, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
/** |
||||
* Benchmark client module |
||||
* @module |
||||
*/ |
||||
|
||||
'use strict'; |
||||
|
||||
var fs = require('fs'); |
||||
var path = require('path'); |
||||
var util = require('util'); |
||||
var EventEmitter = require('events'); |
||||
var _ = require('lodash'); |
||||
var PoissonProcess = require('poisson-process'); |
||||
var Histogram = require('./histogram'); |
||||
var grpc = require('../../../'); |
||||
var serviceProto = grpc.load({ |
||||
root: __dirname + '/../../..', |
||||
file: 'test/proto/benchmarks/services.proto'}).grpc.testing; |
||||
|
||||
/** |
||||
* Create a buffer filled with size zeroes |
||||
* @param {number} size The length of the buffer |
||||
* @return {Buffer} The new buffer |
||||
*/ |
||||
function zeroBuffer(size) { |
||||
var zeros = new Buffer(size); |
||||
zeros.fill(0); |
||||
return zeros; |
||||
} |
||||
|
||||
/** |
||||
* Convert a time difference, as returned by process.hrtime, to a number of |
||||
* nanoseconds. |
||||
* @param {Array.<number>} time_diff The time diff, represented as |
||||
* [seconds, nanoseconds] |
||||
* @return {number} The total number of nanoseconds |
||||
*/ |
||||
function timeDiffToNanos(time_diff) { |
||||
return time_diff[0] * 1e9 + time_diff[1]; |
||||
} |
||||
|
||||
/** |
||||
* The BenchmarkClient class. Opens channels to servers and makes RPCs based on |
||||
* parameters from the driver, and records statistics about those RPCs. |
||||
* @param {Array.<string>} server_targets List of servers to connect to |
||||
* @param {number} channels The total number of channels to open |
||||
* @param {Object} histogram_params Options for setting up the histogram |
||||
* @param {Object=} security_params Options for TLS setup. If absent, don't use |
||||
* TLS |
||||
*/ |
||||
function BenchmarkClient(server_targets, channels, histogram_params, |
||||
security_params) { |
||||
var options = {}; |
||||
var creds; |
||||
if (security_params) { |
||||
var ca_path; |
||||
if (security_params.use_test_ca) { |
||||
ca_path = path.join(__dirname, '../test/data/ca.pem'); |
||||
var ca_data = fs.readFileSync(ca_path); |
||||
creds = grpc.credentials.createSsl(ca_data); |
||||
} else { |
||||
creds = grpc.credentials.createSsl(); |
||||
} |
||||
if (security_params.server_host_override) { |
||||
var host_override = security_params.server_host_override; |
||||
options['grpc.ssl_target_name_override'] = host_override; |
||||
options['grpc.default_authority'] = host_override; |
||||
} |
||||
} else { |
||||
creds = grpc.credentials.createInsecure(); |
||||
} |
||||
|
||||
this.clients = []; |
||||
|
||||
for (var i = 0; i < channels; i++) { |
||||
this.clients[i] = new serviceProto.BenchmarkService( |
||||
server_targets[i % server_targets.length], creds, options); |
||||
} |
||||
|
||||
this.histogram = new Histogram(histogram_params.resolution, |
||||
histogram_params.max_possible); |
||||
|
||||
this.running = false; |
||||
|
||||
this.pending_calls = 0; |
||||
}; |
||||
|
||||
util.inherits(BenchmarkClient, EventEmitter); |
||||
|
||||
/** |
||||
* Start a closed-loop test. For each channel, start |
||||
* outstanding_rpcs_per_channel RPCs. Then, whenever an RPC finishes, start |
||||
* another one. |
||||
* @param {number} outstanding_rpcs_per_channel Number of RPCs to start per |
||||
* channel |
||||
* @param {string} rpc_type Which method to call. Should be 'UNARY' or |
||||
* 'STREAMING' |
||||
* @param {number} req_size The size of the payload to send with each request |
||||
* @param {number} resp_size The size of payload to request be sent in responses |
||||
*/ |
||||
BenchmarkClient.prototype.startClosedLoop = function( |
||||
outstanding_rpcs_per_channel, rpc_type, req_size, resp_size) { |
||||
var self = this; |
||||
|
||||
self.running = true; |
||||
|
||||
self.last_wall_time = process.hrtime(); |
||||
|
||||
var makeCall; |
||||
|
||||
var argument = { |
||||
response_size: resp_size, |
||||
payload: { |
||||
body: zeroBuffer(req_size) |
||||
} |
||||
}; |
||||
|
||||
if (rpc_type == 'UNARY') { |
||||
makeCall = function(client) { |
||||
if (self.running) { |
||||
self.pending_calls++; |
||||
var start_time = process.hrtime(); |
||||
client.unaryCall(argument, function(error, response) { |
||||
if (error) { |
||||
self.emit('error', new Error('Client error: ' + error.message)); |
||||
self.running = false; |
||||
return; |
||||
} |
||||
var time_diff = process.hrtime(start_time); |
||||
self.histogram.add(timeDiffToNanos(time_diff)); |
||||
makeCall(client); |
||||
self.pending_calls--; |
||||
if ((!self.running) && self.pending_calls == 0) { |
||||
self.emit('finished'); |
||||
} |
||||
}); |
||||
} |
||||
}; |
||||
} else { |
||||
makeCall = function(client) { |
||||
if (self.running) { |
||||
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)); |
||||
makeCall(client); |
||||
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; |
||||
}); |
||||
} |
||||
}; |
||||
} |
||||
|
||||
_.each(self.clients, function(client) { |
||||
_.times(outstanding_rpcs_per_channel, function() { |
||||
makeCall(client); |
||||
}); |
||||
}); |
||||
}; |
||||
|
||||
/** |
||||
* Start a poisson test. For each channel, this initiates a number of Poisson |
||||
* processes equal to outstanding_rpcs_per_channel, where each Poisson process |
||||
* has the load parameter offered_load. |
||||
* @param {number} outstanding_rpcs_per_channel Number of RPCs to start per |
||||
* channel |
||||
* @param {string} rpc_type Which method to call. Should be 'UNARY' or |
||||
* 'STREAMING' |
||||
* @param {number} req_size The size of the payload to send with each request |
||||
* @param {number} resp_size The size of payload to request be sent in responses |
||||
* @param {number} offered_load The load parameter for the Poisson process |
||||
*/ |
||||
BenchmarkClient.prototype.startPoisson = function( |
||||
outstanding_rpcs_per_channel, rpc_type, req_size, resp_size, offered_load) { |
||||
var self = this; |
||||
|
||||
self.running = true; |
||||
|
||||
self.last_wall_time = process.hrtime(); |
||||
|
||||
var makeCall; |
||||
|
||||
var argument = { |
||||
response_size: resp_size, |
||||
payload: { |
||||
body: zeroBuffer(req_size) |
||||
} |
||||
}; |
||||
|
||||
if (rpc_type == 'UNARY') { |
||||
makeCall = function(client, poisson) { |
||||
if (self.running) { |
||||
self.pending_calls++; |
||||
var start_time = process.hrtime(); |
||||
client.unaryCall(argument, function(error, response) { |
||||
if (error) { |
||||
self.emit('error', new Error('Client error: ' + error.message)); |
||||
self.running = false; |
||||
return; |
||||
} |
||||
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'); |
||||
} |
||||
}); |
||||
} else { |
||||
poisson.stop(); |
||||
} |
||||
}; |
||||
} else { |
||||
makeCall = function(client, poisson) { |
||||
if (self.running) { |
||||
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; |
||||
|
||||
_.each(self.clients, function(client) { |
||||
_.times(outstanding_rpcs_per_channel, function() { |
||||
var p = PoissonProcess.create(averageIntervalMs, function() { |
||||
makeCall(client, p); |
||||
}); |
||||
p.start(); |
||||
}); |
||||
}); |
||||
}; |
||||
|
||||
/** |
||||
* Return curent statistics for the client. If reset is set, restart |
||||
* statistic collection. |
||||
* @param {boolean} reset Indicates that statistics should be reset |
||||
* @return {object} Client statistics |
||||
*/ |
||||
BenchmarkClient.prototype.mark = function(reset) { |
||||
var wall_time_diff = process.hrtime(this.last_wall_time); |
||||
var histogram = this.histogram; |
||||
if (reset) { |
||||
this.last_wall_time = process.hrtime(); |
||||
this.histogram = new Histogram(histogram.resolution, |
||||
histogram.max_possible); |
||||
} |
||||
|
||||
return { |
||||
latencies: { |
||||
bucket: histogram.getContents(), |
||||
min_seen: histogram.minimum(), |
||||
max_seen: histogram.maximum(), |
||||
sum: histogram.getSum(), |
||||
sum_of_squares: histogram.sumOfSquares(), |
||||
count: histogram.getCount() |
||||
}, |
||||
time_elapsed: wall_time_diff[0] + wall_time_diff[1] / 1e9, |
||||
// Not sure how to measure these values
|
||||
time_user: 0, |
||||
time_system: 0 |
||||
}; |
||||
}; |
||||
|
||||
/** |
||||
* Stop the clients. |
||||
* @param {function} callback Called when the clients have finished shutting |
||||
* down |
||||
*/ |
||||
BenchmarkClient.prototype.stop = function(callback) { |
||||
this.running = false; |
||||
this.on('finished', callback); |
||||
}; |
||||
|
||||
module.exports = BenchmarkClient; |
@ -0,0 +1,162 @@ |
||||
/* |
||||
* |
||||
* Copyright 2015, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
/** |
||||
* Benchmark server module |
||||
* @module |
||||
*/ |
||||
|
||||
'use strict'; |
||||
|
||||
var fs = require('fs'); |
||||
var path = require('path'); |
||||
|
||||
var grpc = require('../../../'); |
||||
var serviceProto = grpc.load({ |
||||
root: __dirname + '/../../..', |
||||
file: 'test/proto/benchmarks/services.proto'}).grpc.testing; |
||||
|
||||
/** |
||||
* Create a buffer filled with size zeroes |
||||
* @param {number} size The length of the buffer |
||||
* @return {Buffer} The new buffer |
||||
*/ |
||||
function zeroBuffer(size) { |
||||
var zeros = new Buffer(size); |
||||
zeros.fill(0); |
||||
return zeros; |
||||
} |
||||
|
||||
/** |
||||
* Handler for the unary benchmark method. Simply responds with a payload |
||||
* containing the requested number of zero bytes. |
||||
* @param {Call} call The call object to be handled |
||||
* @param {function} callback The callback to call with the response |
||||
*/ |
||||
function unaryCall(call, callback) { |
||||
var req = call.request; |
||||
var payload = {body: zeroBuffer(req.response_size)}; |
||||
callback(null, {payload: payload}); |
||||
} |
||||
|
||||
/** |
||||
* Handler for the streaming benchmark method. Simply responds to each request |
||||
* with a payload containing the requested number of zero bytes. |
||||
* @param {Call} call The call object to be handled |
||||
*/ |
||||
function streamingCall(call) { |
||||
call.on('data', function(value) { |
||||
var payload = {body: zeroBuffer(value.repsonse_size)}; |
||||
call.write({payload: payload}); |
||||
}); |
||||
call.on('end', function() { |
||||
call.end(); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* BenchmarkServer class. Constructed based on parameters from the driver and |
||||
* stores statistics. |
||||
* @param {string} host The host to serve on |
||||
* @param {number} port The port to listen to |
||||
* @param {tls} Indicates whether TLS should be used |
||||
*/ |
||||
function BenchmarkServer(host, port, tls) { |
||||
var server_creds; |
||||
var host_override; |
||||
if (tls) { |
||||
var key_path = path.join(__dirname, '../test/data/server1.key'); |
||||
var pem_path = path.join(__dirname, '../test/data/server1.pem'); |
||||
|
||||
var key_data = fs.readFileSync(key_path); |
||||
var pem_data = fs.readFileSync(pem_path); |
||||
server_creds = grpc.ServerCredentials.createSsl(null, |
||||
[{private_key: key_data, |
||||
cert_chain: pem_data}]); |
||||
} else { |
||||
server_creds = grpc.ServerCredentials.createInsecure(); |
||||
} |
||||
|
||||
var server = new grpc.Server(); |
||||
this.port = server.bind(host + ':' + port, server_creds); |
||||
server.addProtoService(serviceProto.BenchmarkService.service, { |
||||
unaryCall: unaryCall, |
||||
streamingCall: streamingCall |
||||
}); |
||||
this.server = server; |
||||
} |
||||
|
||||
/** |
||||
* Start the benchmark server. |
||||
*/ |
||||
BenchmarkServer.prototype.start = function() { |
||||
this.server.start(); |
||||
this.last_wall_time = process.hrtime(); |
||||
}; |
||||
|
||||
/** |
||||
* Return the port number that the server is bound to. |
||||
* @return {Number} The port number |
||||
*/ |
||||
BenchmarkServer.prototype.getPort = function() { |
||||
return this.port; |
||||
}; |
||||
|
||||
/** |
||||
* Return current statistics for the server. If reset is set, restart |
||||
* statistic collection. |
||||
* @param {boolean} reset Indicates that statistics should be reset |
||||
* @return {object} Server statistics |
||||
*/ |
||||
BenchmarkServer.prototype.mark = function(reset) { |
||||
var wall_time_diff = process.hrtime(this.last_wall_time); |
||||
if (reset) { |
||||
this.last_wall_time = process.hrtime(); |
||||
} |
||||
return { |
||||
time_elapsed: wall_time_diff[0] + wall_time_diff[1] / 1e9, |
||||
// Not sure how to measure these values
|
||||
time_user: 0, |
||||
time_system: 0 |
||||
}; |
||||
}; |
||||
|
||||
/** |
||||
* Stop the server. |
||||
* @param {function} callback Called when the server has finished shutting down |
||||
*/ |
||||
BenchmarkServer.prototype.stop = function(callback) { |
||||
this.server.tryShutdown(callback); |
||||
}; |
||||
|
||||
module.exports = BenchmarkServer; |
@ -0,0 +1,180 @@ |
||||
/* |
||||
* |
||||
* Copyright 2015, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
/** |
||||
* Histogram module. Exports the Histogram class |
||||
* @module |
||||
*/ |
||||
|
||||
'use strict'; |
||||
|
||||
/** |
||||
* Histogram class. Collects data and exposes a histogram and other statistics. |
||||
* This data structure is taken directly from src/core/support/histogram.c, but |
||||
* pared down to the statistics needed for client stats in |
||||
* test/proto/benchmarks/stats.proto. |
||||
* @constructor |
||||
* @param {number} resolution The histogram's bucket resolution. Must be positive |
||||
* @param {number} max_possible The maximum allowed value. Must be greater than 1 |
||||
*/ |
||||
function Histogram(resolution, max_possible) { |
||||
this.resolution = resolution; |
||||
this.max_possible = max_possible; |
||||
|
||||
this.sum = 0; |
||||
this.sum_of_squares = 0; |
||||
this.multiplier = 1 + resolution; |
||||
this.count = 0; |
||||
this.min_seen = max_possible; |
||||
this.max_seen = 0; |
||||
this.buckets = []; |
||||
for (var i = 0; i < this.bucketFor(max_possible) + 1; i++) { |
||||
this.buckets[i] = 0; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Get the bucket index for a given value. |
||||
* @param {number} value The value to check |
||||
* @return {number} The bucket index |
||||
*/ |
||||
Histogram.prototype.bucketFor = function(value) { |
||||
return Math.floor(Math.log(value) / Math.log(this.multiplier)); |
||||
}; |
||||
|
||||
/** |
||||
* Get the minimum value for a given bucket index |
||||
* @param {number} The bucket index to check |
||||
* @return {number} The minimum value for that bucket |
||||
*/ |
||||
Histogram.prototype.bucketStart = function(index) { |
||||
return Math.pow(this.multiplier, index); |
||||
}; |
||||
|
||||
/** |
||||
* Add a value to the histogram. This updates all statistics with the new |
||||
* value. Those statistics should not be modified except with this function |
||||
* @param {number} value The value to add |
||||
*/ |
||||
Histogram.prototype.add = function(value) { |
||||
// Ensure value is a number
|
||||
value = +value; |
||||
this.sum += value; |
||||
this.sum_of_squares += value * value; |
||||
this.count++; |
||||
if (value < this.min_seen) { |
||||
this.min_seen = value; |
||||
} |
||||
if (value > this.max_seen) { |
||||
this.max_seen = value; |
||||
} |
||||
this.buckets[this.bucketFor(value)]++; |
||||
}; |
||||
|
||||
/** |
||||
* Get the mean of all added values |
||||
* @return {number} The mean |
||||
*/ |
||||
Histogram.prototype.mean = function() { |
||||
return this.sum / this.count; |
||||
}; |
||||
|
||||
/** |
||||
* Get the variance of all added values. Used to calulate the standard deviation |
||||
* @return {number} The variance |
||||
*/ |
||||
Histogram.prototype.variance = function() { |
||||
if (this.count == 0) { |
||||
return 0; |
||||
} |
||||
return (this.sum_of_squares * this.count - this.sum * this.sum) / |
||||
(this.count * this.count); |
||||
}; |
||||
|
||||
/** |
||||
* Get the standard deviation of all added values |
||||
* @return {number} The standard deviation |
||||
*/ |
||||
Histogram.prototype.stddev = function() { |
||||
return Math.sqrt(this.variance); |
||||
}; |
||||
|
||||
/** |
||||
* Get the maximum among all added values |
||||
* @return {number} The maximum |
||||
*/ |
||||
Histogram.prototype.maximum = function() { |
||||
return this.max_seen; |
||||
}; |
||||
|
||||
/** |
||||
* Get the minimum among all added values |
||||
* @return {number} The minimum |
||||
*/ |
||||
Histogram.prototype.minimum = function() { |
||||
return this.min_seen; |
||||
}; |
||||
|
||||
/** |
||||
* Get the number of all added values |
||||
* @return {number} The count |
||||
*/ |
||||
Histogram.prototype.getCount = function() { |
||||
return this.count; |
||||
}; |
||||
|
||||
/** |
||||
* Get the sum of all added values |
||||
* @return {number} The sum |
||||
*/ |
||||
Histogram.prototype.getSum = function() { |
||||
return this.sum; |
||||
}; |
||||
|
||||
/** |
||||
* Get the sum of squares of all added values |
||||
* @return {number} The sum of squares |
||||
*/ |
||||
Histogram.prototype.sumOfSquares = function() { |
||||
return this.sum_of_squares; |
||||
}; |
||||
|
||||
/** |
||||
* Get the raw histogram as a list of bucket sizes |
||||
* @return {Array.<number>} The buckets |
||||
*/ |
||||
Histogram.prototype.getContents = function() { |
||||
return this.buckets; |
||||
}; |
||||
|
||||
module.exports = Histogram; |
@ -1,119 +0,0 @@ |
||||
/* |
||||
* |
||||
* Copyright 2015, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
'use strict'; |
||||
|
||||
var grpc = require('..'); |
||||
var testProto = grpc.load(__dirname + '/../interop/test.proto').grpc.testing; |
||||
var _ = require('lodash'); |
||||
var interop_server = require('../interop/interop_server.js'); |
||||
|
||||
function runTest(iterations, callback) { |
||||
var testServer = interop_server.getServer(0, false); |
||||
testServer.server.start(); |
||||
var client = new testProto.TestService('localhost:' + testServer.port, |
||||
grpc.credentials.createInsecure()); |
||||
|
||||
function runIterations(finish) { |
||||
var start = process.hrtime(); |
||||
var intervals = []; |
||||
function next(i) { |
||||
if (i >= iterations) { |
||||
testServer.server.shutdown(); |
||||
var totalDiff = process.hrtime(start); |
||||
finish({ |
||||
total: totalDiff[0] * 1000000 + totalDiff[1] / 1000, |
||||
intervals: intervals |
||||
}); |
||||
} else{ |
||||
var deadline = new Date(); |
||||
deadline.setSeconds(deadline.getSeconds() + 3); |
||||
var startTime = process.hrtime(); |
||||
client.emptyCall({}, function(err, resp) { |
||||
var timeDiff = process.hrtime(startTime); |
||||
intervals[i] = timeDiff[0] * 1000000 + timeDiff[1] / 1000; |
||||
next(i+1); |
||||
}, {}, {deadline: deadline}); |
||||
} |
||||
} |
||||
next(0); |
||||
} |
||||
|
||||
function warmUp(num) { |
||||
var pending = num; |
||||
function startCall() { |
||||
client.emptyCall({}, function(err, resp) { |
||||
pending--; |
||||
if (pending === 0) { |
||||
runIterations(callback); |
||||
} |
||||
}); |
||||
} |
||||
for (var i = 0; i < num; i++) { |
||||
startCall(); |
||||
} |
||||
} |
||||
warmUp(100); |
||||
} |
||||
|
||||
function percentile(arr, pct) { |
||||
if (pct > 99) { |
||||
pct = 99; |
||||
} |
||||
if (pct < 0) { |
||||
pct = 0; |
||||
} |
||||
var index = Math.floor(arr.length * pct / 100); |
||||
return arr[index]; |
||||
} |
||||
|
||||
if (require.main === module) { |
||||
var count; |
||||
if (process.argv.length >= 3) { |
||||
count = process.argv[2]; |
||||
} else { |
||||
count = 100; |
||||
} |
||||
runTest(count, function(results) { |
||||
var sorted_intervals = _.sortBy(results.intervals, _.identity); |
||||
console.log('count:', count); |
||||
console.log('total time:', results.total, 'us'); |
||||
console.log('median:', percentile(sorted_intervals, 50), 'us'); |
||||
console.log('90th percentile:', percentile(sorted_intervals, 90), 'us'); |
||||
console.log('95th percentile:', percentile(sorted_intervals, 95), 'us'); |
||||
console.log('99th percentile:', percentile(sorted_intervals, 99), 'us'); |
||||
console.log('QPS:', (count / results.total) * 1000000); |
||||
}); |
||||
} |
||||
|
||||
module.exports = runTest; |
@ -1,137 +0,0 @@ |
||||
/* |
||||
* |
||||
* Copyright 2015, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
/** |
||||
* This script runs a QPS test. It sends requests for a specified length of time |
||||
* with a specified number pending at any one time. It then outputs the measured |
||||
* QPS. Usage: |
||||
* node qps_test.js [--concurrent=count] [--time=seconds] |
||||
* concurrent defaults to 100 and time defaults to 10 |
||||
*/ |
||||
|
||||
'use strict'; |
||||
|
||||
var async = require('async'); |
||||
var parseArgs = require('minimist'); |
||||
|
||||
var grpc = require('..'); |
||||
var testProto = grpc.load(__dirname + '/../interop/test.proto').grpc.testing; |
||||
var interop_server = require('../interop/interop_server.js'); |
||||
|
||||
/** |
||||
* Runs the QPS test. Sends requests constantly for the given number of seconds, |
||||
* and keeps concurrent_calls requests pending at all times. When the test ends, |
||||
* the callback is called with the number of calls that completed within the |
||||
* time limit. |
||||
* @param {number} concurrent_calls The number of calls to have pending |
||||
* simultaneously |
||||
* @param {number} seconds The number of seconds to run the test for |
||||
* @param {function(Error, number)} callback Callback for test completion |
||||
*/ |
||||
function runTest(concurrent_calls, seconds, callback) { |
||||
var testServer = interop_server.getServer(0, false); |
||||
testServer.server.start(); |
||||
var client = new testProto.TestService('localhost:' + testServer.port, |
||||
grpc.credentials.createInsecure()); |
||||
|
||||
var warmup_num = 100; |
||||
|
||||
/** |
||||
* Warms up the client to avoid counting startup time in the test result |
||||
* @param {function(Error)} callback Called when warmup is complete |
||||
*/ |
||||
function warmUp(callback) { |
||||
var pending = warmup_num; |
||||
function startCall() { |
||||
client.emptyCall({}, function(err, resp) { |
||||
if (err) { |
||||
callback(err); |
||||
return; |
||||
} |
||||
pending--; |
||||
if (pending === 0) { |
||||
callback(null); |
||||
} |
||||
}); |
||||
} |
||||
for (var i = 0; i < warmup_num; i++) { |
||||
startCall(); |
||||
} |
||||
} |
||||
/** |
||||
* Run the QPS test. Starts concurrent_calls requests, then starts a new |
||||
* request whenever one completes until time runs out. |
||||
* @param {function(Error, number)} callback Called when the test is complete. |
||||
* The second argument is the number of calls that finished within the |
||||
* time limit |
||||
*/ |
||||
function run(callback) { |
||||
var running = 0; |
||||
var count = 0; |
||||
var start = process.hrtime(); |
||||
function responseCallback(err, resp) { |
||||
if (process.hrtime(start)[0] < seconds) { |
||||
count += 1; |
||||
client.emptyCall({}, responseCallback); |
||||
} else { |
||||
running -= 1; |
||||
if (running <= 0) { |
||||
callback(null, count); |
||||
} |
||||
} |
||||
} |
||||
for (var i = 0; i < concurrent_calls; i++) { |
||||
running += 1; |
||||
client.emptyCall({}, responseCallback); |
||||
} |
||||
} |
||||
async.waterfall([warmUp, run], function(err, count) { |
||||
testServer.server.shutdown(); |
||||
callback(err, count); |
||||
}); |
||||
} |
||||
|
||||
if (require.main === module) { |
||||
var argv = parseArgs(process.argv.slice(2), { |
||||
default: {'concurrent': 100, |
||||
'time': 10} |
||||
}); |
||||
runTest(argv.concurrent, argv.time, function(err, count) { |
||||
if (err) { |
||||
throw err; |
||||
} |
||||
console.log('Concurrent calls:', argv.concurrent); |
||||
console.log('Time:', argv.time, 'seconds'); |
||||
console.log('QPS:', (count/argv.time)); |
||||
}); |
||||
} |
@ -0,0 +1,63 @@ |
||||
/* |
||||
* |
||||
* Copyright 2015, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
'use strict'; |
||||
|
||||
var worker_service_impl = require('./worker_service_impl'); |
||||
|
||||
var grpc = require('../../../'); |
||||
var serviceProto = grpc.load({ |
||||
root: __dirname + '/../../..', |
||||
file: 'test/proto/benchmarks/services.proto'}).grpc.testing; |
||||
|
||||
function runServer(port) { |
||||
var server_creds = grpc.ServerCredentials.createInsecure(); |
||||
var server = new grpc.Server(); |
||||
server.addProtoService(serviceProto.WorkerService.service, |
||||
worker_service_impl); |
||||
var address = '0.0.0.0:' + port; |
||||
server.bind(address, server_creds); |
||||
server.start(); |
||||
return server; |
||||
} |
||||
|
||||
if (require.main === module) { |
||||
Error.stackTraceLimit = Infinity; |
||||
var parseArgs = require('minimist'); |
||||
var argv = parseArgs(process.argv, { |
||||
string: ['driver_port'] |
||||
}); |
||||
runServer(argv.driver_port); |
||||
} |
||||
|
||||
exports.runServer = runServer; |
@ -0,0 +1,132 @@ |
||||
/* |
||||
* |
||||
* Copyright 2015, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
'use strict'; |
||||
|
||||
var BenchmarkClient = require('./benchmark_client'); |
||||
var BenchmarkServer = require('./benchmark_server'); |
||||
|
||||
exports.runClient = function runClient(call) { |
||||
var client; |
||||
call.on('data', function(request) { |
||||
var stats; |
||||
switch (request.argtype) { |
||||
case 'setup': |
||||
var setup = request.setup; |
||||
client = new BenchmarkClient(setup.server_targets, |
||||
setup.client_channels, |
||||
setup.histogram_params, |
||||
setup.security_params); |
||||
client.on('error', function(error) { |
||||
call.emit('error', error); |
||||
}); |
||||
switch (setup.load_params.load) { |
||||
case 'closed_loop': |
||||
client.startClosedLoop(setup.outstanding_rpcs_per_channel, |
||||
setup.rpc_type, |
||||
setup.payload_config.simple_params.req_size, |
||||
setup.payload_config.simple_params.resp_size); |
||||
break; |
||||
case 'poisson': |
||||
client.startPoisson(setup.outstanding_rpcs_per_channel, |
||||
setup.rpc_type, setup.payload_config.req_size, |
||||
setup.payload_config.resp_size, |
||||
setup.load_params.poisson.offered_load); |
||||
break; |
||||
default: |
||||
call.emit('error', new Error('Unsupported LoadParams type' + |
||||
setup.load_params.load)); |
||||
} |
||||
stats = client.mark(); |
||||
call.write({ |
||||
stats: stats |
||||
}); |
||||
break; |
||||
case 'mark': |
||||
if (client) { |
||||
stats = client.mark(request.mark.reset); |
||||
call.write({ |
||||
stats: stats |
||||
}); |
||||
} else { |
||||
call.emit('error', new Error('Got Mark before ClientConfig')); |
||||
} |
||||
break; |
||||
default: |
||||
throw new Error('Nonexistent client argtype option: ' + request.argtype); |
||||
} |
||||
}); |
||||
call.on('end', function() { |
||||
client.stop(function() { |
||||
call.end(); |
||||
}); |
||||
}); |
||||
}; |
||||
|
||||
exports.runServer = function runServer(call) { |
||||
var server; |
||||
call.on('data', function(request) { |
||||
var stats; |
||||
switch (request.argtype) { |
||||
case 'setup': |
||||
server = new BenchmarkServer(request.setup.host, request.setup.port, |
||||
request.setup.security_params); |
||||
server.start(); |
||||
stats = server.mark(); |
||||
call.write({ |
||||
stats: stats, |
||||
port: server.getPort() |
||||
}); |
||||
break; |
||||
case 'mark': |
||||
if (server) { |
||||
stats = server.mark(request.mark.reset); |
||||
call.write({ |
||||
stats: stats, |
||||
port: server.getPort(), |
||||
cores: 1 |
||||
}); |
||||
} else { |
||||
call.emit('error', new Error('Got Mark before ServerConfig')); |
||||
} |
||||
break; |
||||
default: |
||||
throw new Error('Nonexistent server argtype option'); |
||||
} |
||||
}); |
||||
call.on('end', function() { |
||||
server.stop(function() { |
||||
call.end(); |
||||
}); |
||||
}); |
||||
}; |
@ -1,80 +0,0 @@ |
||||
|
||||
// Copyright 2015, Google Inc. |
||||
// All rights reserved. |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without |
||||
// modification, are permitted provided that the following conditions are |
||||
// met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright |
||||
// notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above |
||||
// copyright notice, this list of conditions and the following disclaimer |
||||
// in the documentation and/or other materials provided with the |
||||
// distribution. |
||||
// * Neither the name of Google Inc. nor the names of its |
||||
// contributors may be used to endorse or promote products derived from |
||||
// this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
syntax = "proto3"; |
||||
|
||||
package math; |
||||
|
||||
message DivArgs { |
||||
int64 dividend = 1; |
||||
int64 divisor = 2; |
||||
} |
||||
|
||||
message DivReply { |
||||
int64 quotient = 1; |
||||
int64 remainder = 2; |
||||
} |
||||
|
||||
message FibArgs { |
||||
int64 limit = 1; |
||||
} |
||||
|
||||
message Num { |
||||
int64 num = 1; |
||||
} |
||||
|
||||
message FibReply { |
||||
int64 count = 1; |
||||
} |
||||
|
||||
service Math { |
||||
// Div divides args.dividend by args.divisor and returns the quotient and |
||||
// remainder. |
||||
rpc Div (DivArgs) returns (DivReply) { |
||||
} |
||||
|
||||
// DivMany accepts an arbitrary number of division args from the client stream |
||||
// and sends back the results in the reply stream. The stream continues until |
||||
// the client closes its end; the server does the same after sending all the |
||||
// replies. The stream ends immediately if either end aborts. |
||||
rpc DivMany (stream DivArgs) returns (stream DivReply) { |
||||
} |
||||
|
||||
// Fib generates numbers in the Fibonacci sequence. If args.limit > 0, Fib |
||||
// generates up to limit numbers; otherwise it continues until the call is |
||||
// canceled. Unlike Fib above, Fib has no final FibReply. |
||||
rpc Fib (FibArgs) returns (stream Num) { |
||||
} |
||||
|
||||
// Sum sums a stream of numbers, returning the final result once the stream |
||||
// is closed. |
||||
rpc Sum (stream Num) returns (Num) { |
||||
} |
||||
} |
@ -1,80 +0,0 @@ |
||||
|
||||
// Copyright 2015, Google Inc. |
||||
// All rights reserved. |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without |
||||
// modification, are permitted provided that the following conditions are |
||||
// met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright |
||||
// notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above |
||||
// copyright notice, this list of conditions and the following disclaimer |
||||
// in the documentation and/or other materials provided with the |
||||
// distribution. |
||||
// * Neither the name of Google Inc. nor the names of its |
||||
// contributors may be used to endorse or promote products derived from |
||||
// this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
syntax = "proto3"; |
||||
|
||||
package math; |
||||
|
||||
message DivArgs { |
||||
int64 dividend = 1; |
||||
int64 divisor = 2; |
||||
} |
||||
|
||||
message DivReply { |
||||
int64 quotient = 1; |
||||
int64 remainder = 2; |
||||
} |
||||
|
||||
message FibArgs { |
||||
int64 limit = 1; |
||||
} |
||||
|
||||
message Num { |
||||
int64 num = 1; |
||||
} |
||||
|
||||
message FibReply { |
||||
int64 count = 1; |
||||
} |
||||
|
||||
service Math { |
||||
// Div divides args.dividend by args.divisor and returns the quotient and |
||||
// remainder. |
||||
rpc Div (DivArgs) returns (DivReply) { |
||||
} |
||||
|
||||
// DivMany accepts an arbitrary number of division args from the client stream |
||||
// and sends back the results in the reply stream. The stream continues until |
||||
// the client closes its end; the server does the same after sending all the |
||||
// replies. The stream ends immediately if either end aborts. |
||||
rpc DivMany (stream DivArgs) returns (stream DivReply) { |
||||
} |
||||
|
||||
// Fib generates numbers in the Fibonacci sequence. If args.limit > 0, Fib |
||||
// generates up to limit numbers; otherwise it continues until the call is |
||||
// canceled. Unlike Fib above, Fib has no final FibReply. |
||||
rpc Fib (FibArgs) returns (stream Num) { |
||||
} |
||||
|
||||
// Sum sums a stream of numbers, returning the final result once the stream |
||||
// is closed. |
||||
rpc Sum (stream Num) returns (Num) { |
||||
} |
||||
} |
@ -0,0 +1,51 @@ |
||||
#!/bin/sh |
||||
# Copyright 2015, Google Inc. |
||||
# All rights reserved. |
||||
# |
||||
# Redistribution and use in source and binary forms, with or without |
||||
# modification, are permitted provided that the following conditions are |
||||
# met: |
||||
# |
||||
# * Redistributions of source code must retain the above copyright |
||||
# notice, this list of conditions and the following disclaimer. |
||||
# * Redistributions in binary form must reproduce the above |
||||
# copyright notice, this list of conditions and the following disclaimer |
||||
# in the documentation and/or other materials provided with the |
||||
# distribution. |
||||
# * Neither the name of Google Inc. nor the names of its |
||||
# contributors may be used to endorse or promote products derived from |
||||
# this software without specific prior written permission. |
||||
# |
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
# Regenerates gRPC service stubs from proto files. |
||||
set +e |
||||
cd $(dirname $0)/../../.. |
||||
|
||||
PROTOC=bins/opt/protobuf/protoc |
||||
PLUGIN=protoc-gen-grpc=bins/opt/grpc_ruby_plugin |
||||
|
||||
$PROTOC -I src/proto src/proto/grpc/health/v1alpha/health.proto \ |
||||
--grpc_out=src/ruby/pb \ |
||||
--ruby_out=src/ruby/pb \ |
||||
--plugin=$PLUGIN |
||||
|
||||
$PROTOC -I . test/proto/{messages,test,empty}.proto \ |
||||
--grpc_out=src/ruby/pb \ |
||||
--ruby_out=src/ruby/pb \ |
||||
--plugin=$PLUGIN |
||||
|
||||
$PROTOC -I src/proto/math src/proto/math/math.proto \ |
||||
--grpc_out=src/ruby/bin \ |
||||
--ruby_out=src/ruby/bin \ |
||||
--plugin=$PLUGIN |
@ -0,0 +1,58 @@ |
||||
/*
|
||||
* |
||||
* Copyright 2015, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
#include "test/core/bad_client/bad_client.h" |
||||
#include "src/core/surface/server.h" |
||||
|
||||
#define PFX_STR \ |
||||
"PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" \
|
||||
"\x00\x00\x00\x04\x00\x00\x00\x00\x00" |
||||
|
||||
static void verifier(grpc_server *server, grpc_completion_queue *cq) { |
||||
while (grpc_server_has_open_connections(server)) { |
||||
GPR_ASSERT(grpc_completion_queue_next( |
||||
cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20), NULL) |
||||
.type == GRPC_QUEUE_TIMEOUT); |
||||
} |
||||
} |
||||
|
||||
int main(int argc, char **argv) { |
||||
grpc_test_init(argc, argv); |
||||
|
||||
/* test adding prioritization data */ |
||||
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR |
||||
"\x00\x00\x00\x88\x00\x00\x00\x00\x01", |
||||
GRPC_BAD_CLIENT_DISCONNECT); |
||||
|
||||
return 0; |
||||
} |
@ -0,0 +1,187 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<Import Project="..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props" Condition="Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\1.0.204.1.props')" /> |
||||
<ItemGroup Label="ProjectConfigurations"> |
||||
<ProjectConfiguration Include="Debug|Win32"> |
||||
<Configuration>Debug</Configuration> |
||||
<Platform>Win32</Platform> |
||||
</ProjectConfiguration> |
||||
<ProjectConfiguration Include="Debug|x64"> |
||||
<Configuration>Debug</Configuration> |
||||
<Platform>x64</Platform> |
||||
</ProjectConfiguration> |
||||
<ProjectConfiguration Include="Release|Win32"> |
||||
<Configuration>Release</Configuration> |
||||
<Platform>Win32</Platform> |
||||
</ProjectConfiguration> |
||||
<ProjectConfiguration Include="Release|x64"> |
||||
<Configuration>Release</Configuration> |
||||
<Platform>x64</Platform> |
||||
</ProjectConfiguration> |
||||
</ItemGroup> |
||||
<PropertyGroup Label="Globals"> |
||||
<ProjectGuid>{9E0A2239-20D5-DB2D-CA0D-69F24E3416E7}</ProjectGuid> |
||||
</PropertyGroup> |
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
||||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0'" Label="Configuration"> |
||||
<PlatformToolset>v100</PlatformToolset> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0'" Label="Configuration"> |
||||
<PlatformToolset>v110</PlatformToolset> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '12.0'" Label="Configuration"> |
||||
<PlatformToolset>v120</PlatformToolset> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> |
||||
<ConfigurationType>Application</ConfigurationType> |
||||
<UseDebugLibraries>true</UseDebugLibraries> |
||||
<CharacterSet>Unicode</CharacterSet> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration"> |
||||
<ConfigurationType>Application</ConfigurationType> |
||||
<UseDebugLibraries>false</UseDebugLibraries> |
||||
<WholeProgramOptimization>true</WholeProgramOptimization> |
||||
<CharacterSet>Unicode</CharacterSet> |
||||
</PropertyGroup> |
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
||||
<ImportGroup Label="ExtensionSettings"> |
||||
</ImportGroup> |
||||
<ImportGroup Label="PropertySheets"> |
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
||||
<Import Project="..\..\..\..\vsprojects\global.props" /> |
||||
<Import Project="..\..\..\..\vsprojects\openssl.props" /> |
||||
<Import Project="..\..\..\..\vsprojects\winsock.props" /> |
||||
<Import Project="..\..\..\..\vsprojects\zlib.props" /> |
||||
</ImportGroup> |
||||
<PropertyGroup Label="UserMacros" /> |
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'"> |
||||
<TargetName>unknown_frame_bad_client_test</TargetName> |
||||
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib> |
||||
<Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib> |
||||
<Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'"> |
||||
<TargetName>unknown_frame_bad_client_test</TargetName> |
||||
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib> |
||||
<Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib> |
||||
<Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl> |
||||
</PropertyGroup> |
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
||||
<ClCompile> |
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
||||
<WarningLevel>Level3</WarningLevel> |
||||
<Optimization>Disabled</Optimization> |
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
||||
<SDLCheck>true</SDLCheck> |
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
||||
<TreatWarningAsError>true</TreatWarningAsError> |
||||
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> |
||||
</ClCompile> |
||||
<Link> |
||||
<SubSystem>Console</SubSystem> |
||||
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> |
||||
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> |
||||
</Link> |
||||
</ItemDefinitionGroup> |
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
||||
<ClCompile> |
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
||||
<WarningLevel>Level3</WarningLevel> |
||||
<Optimization>Disabled</Optimization> |
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
||||
<SDLCheck>true</SDLCheck> |
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
||||
<TreatWarningAsError>true</TreatWarningAsError> |
||||
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> |
||||
</ClCompile> |
||||
<Link> |
||||
<SubSystem>Console</SubSystem> |
||||
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> |
||||
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> |
||||
</Link> |
||||
</ItemDefinitionGroup> |
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
||||
<ClCompile> |
||||
<WarningLevel>Level3</WarningLevel> |
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
||||
<Optimization>MaxSpeed</Optimization> |
||||
<FunctionLevelLinking>true</FunctionLevelLinking> |
||||
<IntrinsicFunctions>true</IntrinsicFunctions> |
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
||||
<SDLCheck>true</SDLCheck> |
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
||||
<TreatWarningAsError>true</TreatWarningAsError> |
||||
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> |
||||
</ClCompile> |
||||
<Link> |
||||
<SubSystem>Console</SubSystem> |
||||
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> |
||||
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> |
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
||||
<OptimizeReferences>true</OptimizeReferences> |
||||
</Link> |
||||
</ItemDefinitionGroup> |
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
||||
<ClCompile> |
||||
<WarningLevel>Level3</WarningLevel> |
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
||||
<Optimization>MaxSpeed</Optimization> |
||||
<FunctionLevelLinking>true</FunctionLevelLinking> |
||||
<IntrinsicFunctions>true</IntrinsicFunctions> |
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
||||
<SDLCheck>true</SDLCheck> |
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
||||
<TreatWarningAsError>true</TreatWarningAsError> |
||||
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> |
||||
</ClCompile> |
||||
<Link> |
||||
<SubSystem>Console</SubSystem> |
||||
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> |
||||
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> |
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
||||
<OptimizeReferences>true</OptimizeReferences> |
||||
</Link> |
||||
</ItemDefinitionGroup> |
||||
<ItemGroup> |
||||
<ClCompile Include="..\..\..\..\test\core\bad_client\tests\unknown_frame.c"> |
||||
</ClCompile> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ProjectReference Include="..\..\..\..\vsprojects\vcxproj\test\bad_client_test\bad_client_test.vcxproj"> |
||||
<Project>{BA67B418-B699-E41A-9CC4-0279C49481A5}</Project> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\vsprojects\vcxproj\.\grpc_test_util_unsecure\grpc_test_util_unsecure.vcxproj"> |
||||
<Project>{0A7E7F92-FDEA-40F1-A9EC-3BA484F98BBF}</Project> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\vsprojects\vcxproj\.\grpc_unsecure\grpc_unsecure.vcxproj"> |
||||
<Project>{46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}</Project> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\vsprojects\vcxproj\.\gpr_test_util\gpr_test_util.vcxproj"> |
||||
<Project>{EAB0A629-17A9-44DB-B5FF-E91A721FE037}</Project> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\vsprojects\vcxproj\.\gpr\gpr.vcxproj"> |
||||
<Project>{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}</Project> |
||||
</ProjectReference> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<None Include="packages.config" /> |
||||
</ItemGroup> |
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
||||
<ImportGroup Label="ExtensionTargets"> |
||||
<Import Project="..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets" Condition="Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies\grpc.dependencies.zlib.targets')" /> |
||||
<Import Project="..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets" Condition="Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies\grpc.dependencies.zlib.targets')" /> |
||||
<Import Project="..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets" Condition="Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies\grpc.dependencies.openssl.targets')" /> |
||||
<Import Project="..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets" Condition="Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies\grpc.dependencies.openssl.targets')" /> |
||||
</ImportGroup> |
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> |
||||
<PropertyGroup> |
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> |
||||
</PropertyGroup> |
||||
<Error Condition="!Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets')" /> |
||||
<Error Condition="!Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets')" /> |
||||
<Error Condition="!Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets')" /> |
||||
<Error Condition="!Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props')" /> |
||||
<Error Condition="!Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets')" /> |
||||
</Target> |
||||
</Project> |
||||
|
@ -0,0 +1,24 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<ItemGroup> |
||||
<ClCompile Include="..\..\..\..\test\core\bad_client\tests\unknown_frame.c"> |
||||
<Filter>test\core\bad_client\tests</Filter> |
||||
</ClCompile> |
||||
</ItemGroup> |
||||
|
||||
<ItemGroup> |
||||
<Filter Include="test"> |
||||
<UniqueIdentifier>{77ca54f4-deb2-3a34-5548-0a2bc7cbacc1}</UniqueIdentifier> |
||||
</Filter> |
||||
<Filter Include="test\core"> |
||||
<UniqueIdentifier>{2e30ac00-932d-ab0d-fabf-e0ea035aae46}</UniqueIdentifier> |
||||
</Filter> |
||||
<Filter Include="test\core\bad_client"> |
||||
<UniqueIdentifier>{527abde4-b314-c50f-b007-dd3fdb2445ba}</UniqueIdentifier> |
||||
</Filter> |
||||
<Filter Include="test\core\bad_client\tests"> |
||||
<UniqueIdentifier>{691de782-c331-3836-ac26-43873334f0c0}</UniqueIdentifier> |
||||
</Filter> |
||||
</ItemGroup> |
||||
</Project> |
||||
|
Loading…
Reference in new issue