Make number of stubs per channel configurable and expose metrics from

client
reviewable/pr4035/r1
Sree Kuchibhotla 9 years ago
parent 241a5ad3cb
commit b5e98c5c69
  1. 72
      Makefile
  2. 17
      build.yaml
  3. 98
      test/cpp/interop/metrics_client.cc
  4. 44
      test/cpp/interop/stress_interop_client.cc
  5. 13
      test/cpp/interop/stress_interop_client.h
  6. 53
      test/cpp/interop/stress_test.cc
  7. 118
      test/cpp/util/metrics_server.cc
  8. 101
      test/cpp/util/metrics_server.h
  9. 51
      test/proto/metrics.proto
  10. 26
      tools/run_tests/sources_and_headers.json
  11. 197
      vsprojects/vcxproj/test/metrics_client/metrics_client.vcxproj
  12. 35
      vsprojects/vcxproj/test/metrics_client/metrics_client.vcxproj.filters
  13. 11
      vsprojects/vcxproj/test/stress_test/stress_test.vcxproj
  14. 12
      vsprojects/vcxproj/test/stress_test/stress_test.vcxproj.filters

File diff suppressed because one or more lines are too long

@ -1891,6 +1891,20 @@ targets:
- mac
- linux
- posix
- name: metrics_client
build: test
run: false
language: c++
headers:
- test/cpp/util/metrics_server.h
src:
- test/proto/metrics.proto
- test/cpp/interop/metrics_client.cc
deps:
- grpc++
- grpc
- gpr
- grpc++_test_config
- name: mock_test
build: test
language: c++
@ -2114,13 +2128,16 @@ targets:
- test/cpp/interop/client_helper.h
- test/cpp/interop/interop_client.h
- test/cpp/interop/stress_interop_client.h
- test/cpp/util/metrics_server.h
src:
- test/proto/empty.proto
- test/proto/messages.proto
- test/proto/metrics.proto
- test/proto/test.proto
- test/cpp/interop/interop_client.cc
- test/cpp/interop/stress_interop_client.cc
- test/cpp/interop/stress_test.cc
- test/cpp/util/metrics_server.cc
deps:
- grpc++_test_util
- grpc_test_util

@ -0,0 +1,98 @@
/*
*
* 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.
*is % allowed in string
*/
#include <memory>
#include <string>
#include <gflags/gflags.h>
#include <grpc++/grpc++.h>
#include "test/cpp/util/metrics_server.h"
#include "test/cpp/util/test_config.h"
#include "test/proto/metrics.grpc.pb.h"
#include "test/proto/metrics.pb.h"
DEFINE_string(metrics_server_address, "",
"The metrics server addresses in the fomrat <hostname>:<port>");
using grpc::testing::EmptyMessage;
using grpc::testing::GuageResponse;
using grpc::testing::MetricsService;
using grpc::testing::MetricsServiceImpl;
void PrintMetrics(grpc::string& server_address) {
gpr_log(GPR_INFO, "creating a channel to %s", server_address.c_str());
std::shared_ptr<grpc::Channel> channel(
grpc::CreateChannel(server_address, grpc::InsecureCredentials()));
std::unique_ptr<MetricsService::Stub> stub(MetricsService::NewStub(channel));
grpc::ClientContext context;
EmptyMessage message;
std::unique_ptr<grpc::ClientReader<GuageResponse>> reader(
stub->GetAllGuages(&context, message));
GuageResponse guage_response;
long overall_rps = 0;
int idx = 0;
while (reader->Read(&guage_response)) {
gpr_log(GPR_INFO, "Guage: %d (%s: %ld)", ++idx,
guage_response.name().c_str(), guage_response.value());
overall_rps += guage_response.value();
}
gpr_log(GPR_INFO, "OVERALL: %ld", overall_rps);
const grpc::Status status = reader->Finish();
if (!status.ok()) {
gpr_log(GPR_ERROR, "Error in getting metrics from the client");
}
}
int main(int argc, char** argv) {
grpc::testing::InitTest(&argc, &argv, true);
// Make sure server_addresses flag is not empty
if (FLAGS_metrics_server_address.length() == 0) {
gpr_log(
GPR_ERROR,
"Cannot connect to the Metrics server. Please pass the address of the"
"metrics server to connect to via the 'metrics_server_address' flag");
return 1;
}
PrintMetrics(FLAGS_metrics_server_address);
return 0;
}

@ -40,6 +40,7 @@
#include <grpc++/create_channel.h>
#include "test/cpp/interop/interop_client.h"
#include "test/cpp/util/metrics_server.h"
namespace grpc {
namespace testing {
@ -81,21 +82,19 @@ TestCaseType WeightedRandomTestSelector::GetNextTest() const {
StressTestInteropClient::StressTestInteropClient(
int test_id, const grpc::string& server_address,
std::shared_ptr<Channel> channel,
const WeightedRandomTestSelector& test_selector, long test_duration_secs,
long sleep_duration_ms)
long sleep_duration_ms, long metrics_collection_interval_secs)
: test_id_(test_id),
server_address_(server_address),
channel_(channel),
interop_client_(new InteropClient(channel, false)),
test_selector_(test_selector),
test_duration_secs_(test_duration_secs),
sleep_duration_ms_(sleep_duration_ms) {
// TODO(sreek): This will change once we add support for other tests
// that won't work with InsecureCredentials()
std::shared_ptr<Channel> channel(
CreateChannel(server_address, InsecureCredentials()));
interop_client_.reset(new InteropClient(channel, false));
}
sleep_duration_ms_(sleep_duration_ms),
metrics_collection_interval_secs_(metrics_collection_interval_secs) {}
void StressTestInteropClient::MainLoop() {
void StressTestInteropClient::MainLoop(std::shared_ptr<Guage> rps_guage) {
gpr_log(GPR_INFO, "Running test %d. ServerAddr: %s", test_id_,
server_address_.c_str());
@ -104,21 +103,38 @@ void StressTestInteropClient::MainLoop() {
gpr_time_from_seconds(test_duration_secs_, GPR_TIMESPAN));
gpr_timespec current_time = gpr_now(GPR_CLOCK_REALTIME);
gpr_timespec next_stat_collection_time = current_time;
gpr_timespec collection_interval =
gpr_time_from_seconds(metrics_collection_interval_secs_, GPR_TIMESPAN);
long num_calls_per_interval = 0;
while (test_duration_secs_ < 0 ||
gpr_time_cmp(current_time, test_end_time) < 0) {
gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), test_end_time) < 0) {
// Select the test case to execute based on the weights and execute it
TestCaseType test_case = test_selector_.GetNextTest();
gpr_log(GPR_INFO, "%d - Executing the test case %d", test_id_, test_case);
RunTest(test_case);
num_calls_per_interval++;
// See if its time to collect stats yet
current_time = gpr_now(GPR_CLOCK_REALTIME);
if (gpr_time_cmp(next_stat_collection_time, current_time) < 0) {
rps_guage->Set(num_calls_per_interval /
metrics_collection_interval_secs_);
num_calls_per_interval = 0;
next_stat_collection_time =
gpr_time_add(current_time, collection_interval);
}
// Sleep between successive calls if needed
if (sleep_duration_ms_ > 0) {
gpr_timespec sleep_time = gpr_time_add(
current_time, gpr_time_from_millis(sleep_duration_ms_, GPR_TIMESPAN));
gpr_timespec sleep_time =
gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
gpr_time_from_millis(sleep_duration_ms_, GPR_TIMESPAN));
gpr_sleep_until(sleep_time);
}
current_time = gpr_now(GPR_CLOCK_REALTIME);
}
}

@ -41,6 +41,7 @@
#include <grpc++/create_channel.h>
#include "test/cpp/interop/interop_client.h"
#include "test/cpp/util/metrics_server.h"
namespace grpc {
namespace testing {
@ -84,20 +85,26 @@ class WeightedRandomTestSelector {
class StressTestInteropClient {
public:
StressTestInteropClient(int test_id, const grpc::string& server_address,
std::shared_ptr<Channel> channel,
const WeightedRandomTestSelector& test_selector,
long test_duration_secs, long sleep_duration_ms);
long test_duration_secs, long sleep_duration_ms,
long metrics_collection_interval_secs);
void MainLoop(); // The main function. Use this as the thread entry point.
// The main funciton. Use this as the thread entry point.
// rps_guage is the Guage to record the request per second metric
void MainLoop(std::shared_ptr<Guage> rps_guage);
private:
void RunTest(TestCaseType test_case);
int test_id_;
std::unique_ptr<InteropClient> interop_client_;
const grpc::string& server_address_;
std::shared_ptr<Channel> channel_;
std::unique_ptr<InteropClient> interop_client_;
const WeightedRandomTestSelector& test_selector_;
long test_duration_secs_;
long sleep_duration_ms_;
long metrics_collection_interval_secs_;
};
} // namespace testing

@ -44,7 +44,15 @@
#include "test/cpp/interop/interop_client.h"
#include "test/cpp/interop/stress_interop_client.h"
#include "test/cpp/util/metrics_server.h"
#include "test/cpp/util/test_config.h"
#include "test/proto/metrics.grpc.pb.h"
#include "test/proto/metrics.pb.h"
DEFINE_int32(metrics_port, 8081, "The metrics server port.");
DEFINE_int32(metrics_collection_interval_secs, 5,
"How often (in seconds) should metrics be recorded.");
DEFINE_int32(sleep_duration_ms, 0,
"The duration (in millisec) between two"
@ -61,6 +69,11 @@ DEFINE_string(server_addresses, "localhost:8080",
" \"<name_1>:<port_1>,<name_2>:<port_1>...<name_N>:<port_N>\"\n"
" Note: <name> can be servername or IP address.");
DEFINE_int32(num_stubs_per_channel, 1,
"Number of stubs per each channels to server. This number also "
"indicates the max number of parallel RPC calls on each channel "
"at any given time.");
// TODO(sreek): Add more test cases here in future
DEFINE_string(test_cases, "",
"List of test cases to call along with the"
@ -84,10 +97,12 @@ using std::thread;
using std::vector;
using grpc::testing::kTestCaseList;
using grpc::testing::MetricsService;
using grpc::testing::MetricsServiceImpl;
using grpc::testing::StressTestInteropClient;
using grpc::testing::TestCaseType;
using grpc::testing::WeightedRandomTestSelector;
using grpc::testing::UNKNOWN_TEST;
using grpc::testing::WeightedRandomTestSelector;
TestCaseType GetTestTypeFromName(const grpc::string& test_name) {
TestCaseType test_case = UNKNOWN_TEST;
@ -199,23 +214,47 @@ int main(int argc, char** argv) {
LogParameterInfo(server_addresses, tests);
WeightedRandomTestSelector test_selector(tests);
MetricsServiceImpl metrics_service;
gpr_log(GPR_INFO, "Starting test(s)..");
vector<thread> test_threads;
int thread_idx = 0;
for (auto it = server_addresses.begin(); it != server_addresses.end(); it++) {
StressTestInteropClient* client = new StressTestInteropClient(
++thread_idx, *it, test_selector, FLAGS_test_duration_secs,
FLAGS_sleep_duration_ms);
test_threads.emplace_back(
thread(&StressTestInteropClient::MainLoop, client));
// TODO(sreek): This will change once we add support for other tests
// that won't work with InsecureCredentials()
std::shared_ptr<grpc::Channel> channel(
CreateChannel(*it, grpc::InsecureCredentials()));
// Make multiple stubs (as defined by num_stubs_per_channel flag) to use the
// same channel. This is to test calling multiple RPC calls in parallel on
// each channel.
for (int i = 0; i < FLAGS_num_stubs_per_channel; i++) {
StressTestInteropClient* client = new StressTestInteropClient(
++thread_idx, *it, channel, test_selector, FLAGS_test_duration_secs,
FLAGS_sleep_duration_ms, FLAGS_metrics_collection_interval_secs);
bool is_already_created;
grpc::string metricName = "/stress_test/rps/thread/" + std::to_string(i);
test_threads.emplace_back(
thread(&StressTestInteropClient::MainLoop, client,
metrics_service.CreateGuage(metricName, is_already_created)));
// The Guage should not have been already created
GPR_ASSERT(!is_already_created);
}
}
// Start metrics server before waiting for the stress test threads
std::unique_ptr<grpc::Server> metrics_server =
metrics_service.StartServer(FLAGS_metrics_port);
// Wait for the stress test threads to complete
for (auto it = test_threads.begin(); it != test_threads.end(); it++) {
it->join();
}
metrics_server->Wait();
return 0;
}

@ -0,0 +1,118 @@
/*
*
* 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.
*is % allowed in string
*/
#include "test/cpp/util/metrics_server.h"
#include <vector>
#include <grpc++/server_builder.h>
#include "test/proto/metrics.grpc.pb.h"
#include "test/proto/metrics.pb.h"
namespace grpc {
namespace testing {
using std::vector;
Guage::Guage(long initial_val) : val_(initial_val) {}
void Guage::Set(long new_val) {
val_.store(new_val, std::memory_order_relaxed);
}
long Guage::Get() { return val_.load(std::memory_order_relaxed); }
grpc::Status MetricsServiceImpl::GetAllGuages(
ServerContext* context, const EmptyMessage* request,
ServerWriter<GuageResponse>* writer) {
gpr_log(GPR_INFO, "GetAllGuages called");
std::lock_guard<std::mutex> lock(mu_);
for (auto it = guages_.begin(); it != guages_.end(); it++) {
GuageResponse resp;
resp.set_name(it->first); // Guage name
resp.set_value(it->second->Get()); // Guage value
writer->Write(resp);
}
return Status::OK;
}
grpc::Status MetricsServiceImpl::GetGuage(ServerContext* context,
const GuageRequest* request,
GuageResponse* response) {
std::lock_guard<std::mutex> lock(mu_);
auto it = guages_.find(request->name());
if (it != guages_.end()) {
response->set_name(it->first);
response->set_value(it->second->Get());
}
return Status::OK;
}
std::shared_ptr<Guage> MetricsServiceImpl::CreateGuage(string name,
bool& already_present) {
std::lock_guard<std::mutex> lock(mu_);
std::shared_ptr<Guage> guage(new Guage(0));
auto p = guages_.emplace(name, guage);
// p.first is an iterator pointing to <name, shared_ptr<Guage>> pair. p.second
// is a boolean indicating if the Guage is already present in the map
already_present = !p.second;
return p.first->second;
}
// Starts the metrics server and returns the grpc::Server instance. Call
// wait() on the returned server instance.
std::unique_ptr<grpc::Server> MetricsServiceImpl::StartServer(int port) {
gpr_log(GPR_INFO, "Building metrics server..");
grpc::string address = "0.0.0.0:" + std::to_string(port);
ServerBuilder builder;
builder.AddListeningPort(address, grpc::InsecureServerCredentials());
builder.RegisterService(this);
std::unique_ptr<grpc::Server> server(builder.BuildAndStart());
gpr_log(GPR_INFO, "Metrics server %s started. Ready to receive requests..",
address.c_str());
return server;
}
} // namespace testing
} // namespace grpc

@ -0,0 +1,101 @@
/*
*
* 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.
*is % allowed in string
*/
#ifndef GRPC_TEST_CPP_METRICS_SERVER_H
#define GRPC_TEST_CPP_METRICS_SERVER_H
#include <atomic>
#include <map>
#include <mutex>
#include <vector>
#include "test/proto/metrics.grpc.pb.h"
#include "test/proto/metrics.pb.h"
/*
* This implements a Metrics server defined in test/proto/metrics.proto. Any
* test service can use this to export Metrics (TODO (sreek): Only Guages for
* now).
*
* Example:
* MetricsServiceImpl metricsImpl;
* ..
* // Create Guage(s). Note: Guages can be created even after calling
* // 'StartServer'.
* Guage guage1 = metricsImpl.CreateGuage("foo",is_present);
* // guage1 can now be used anywhere in the program to set values.
* ...
* // Create the metrics server
* std::unique_ptr<grpc::Server> server = metricsImpl.StartServer(port);
* server->Wait(); // Note: This is blocking.
*/
namespace grpc {
namespace testing {
using std::map;
using std::vector;
class Guage {
public:
Guage(long initial_val);
void Set(long new_val);
long Get();
private:
std::atomic_long val_;
};
class MetricsServiceImpl GRPC_FINAL : public MetricsService::Service {
public:
grpc::Status GetAllGuages(ServerContext* context, const EmptyMessage* request,
ServerWriter<GuageResponse>* writer) GRPC_OVERRIDE;
grpc::Status GetGuage(ServerContext* context, const GuageRequest* request,
GuageResponse* response) GRPC_OVERRIDE;
// Create a Guage with name 'name'. is_present is set to true if the Guage
// is already present in the map.
// NOTE: CreateGuage can be called anytime (i.e before or after calling
// StartServer).
std::shared_ptr<Guage> CreateGuage(string name, bool& is_present);
std::unique_ptr<grpc::Server> StartServer(int port);
private:
std::map<string, std::shared_ptr<Guage>> guages_;
std::mutex mu_;
};
} // namespace testing
} // namespace grpc
#endif // GRPC_TEST_CPP_METRICS_SERVER_H

@ -0,0 +1,51 @@
// 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.
// An integration test service that covers all the method signature permutations
// of unary/streaming requests/responses.
syntax = "proto3";
package grpc.testing;
message GuageResponse {
string name = 1;
int64 value = 2;
}
message GuageRequest {
string name = 1;
}
message EmptyMessage {}
service MetricsService {
rpc GetAllGuages(EmptyMessage) returns (stream GuageResponse);
rpc GetGuage(GuageRequest) returns (GuageResponse);
}

@ -1412,6 +1412,25 @@
"test/cpp/interop/interop_test.cc"
]
},
{
"deps": [
"gpr",
"grpc",
"grpc++",
"grpc++_test_config"
],
"headers": [
"test/cpp/util/metrics_server.h",
"test/proto/metrics.grpc.pb.h",
"test/proto/metrics.pb.h"
],
"language": "c++",
"name": "metrics_client",
"src": [
"test/cpp/interop/metrics_client.cc",
"test/cpp/util/metrics_server.h"
]
},
{
"deps": [
"gpr",
@ -1680,10 +1699,13 @@
"test/cpp/interop/client_helper.h",
"test/cpp/interop/interop_client.h",
"test/cpp/interop/stress_interop_client.h",
"test/cpp/util/metrics_server.h",
"test/proto/empty.grpc.pb.h",
"test/proto/empty.pb.h",
"test/proto/messages.grpc.pb.h",
"test/proto/messages.pb.h",
"test/proto/metrics.grpc.pb.h",
"test/proto/metrics.pb.h",
"test/proto/test.grpc.pb.h",
"test/proto/test.pb.h"
],
@ -1695,7 +1717,9 @@
"test/cpp/interop/interop_client.h",
"test/cpp/interop/stress_interop_client.cc",
"test/cpp/interop/stress_interop_client.h",
"test/cpp/interop/stress_test.cc"
"test/cpp/interop/stress_test.cc",
"test/cpp/util/metrics_server.cc",
"test/cpp/util/metrics_server.h"
]
},
{

@ -0,0 +1,197 @@
<?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.2.3\build\native\grpc.dependencies.openssl.props" Condition="Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.2.3\build\native\1.0.2.3.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>{FE8631BA-DF40-EC70-6078-C2DAF316E329}</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\cpptest.props" />
<Import Project="..\..\..\..\vsprojects\global.props" />
<Import Project="..\..\..\..\vsprojects\openssl.props" />
<Import Project="..\..\..\..\vsprojects\protobuf.props" />
<Import Project="..\..\..\..\vsprojects\winsock.props" />
<Import Project="..\..\..\..\vsprojects\zlib.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<TargetName>metrics_client</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>metrics_client</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>
<ClInclude Include="..\..\..\..\test\cpp\util\metrics_server.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\test\proto\metrics.pb.cc">
</ClCompile>
<ClInclude Include="..\..\..\..\test\proto\metrics.pb.h">
</ClInclude>
<ClCompile Include="..\..\..\..\test\proto\metrics.grpc.pb.cc">
</ClCompile>
<ClInclude Include="..\..\..\..\test\proto\metrics.grpc.pb.h">
</ClInclude>
<ClCompile Include="..\..\..\..\test\cpp\interop\metrics_client.cc">
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\vsprojects\vcxproj\.\grpc++\grpc++.vcxproj">
<Project>{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\vsprojects\vcxproj\.\grpc\grpc.vcxproj">
<Project>{29D16885-7228-4C31-81ED-5F9187C7F2A9}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\vsprojects\vcxproj\.\gpr\gpr.vcxproj">
<Project>{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\vsprojects\vcxproj\.\grpc++_test_config\grpc++_test_config.vcxproj">
<Project>{3F7D093D-11F9-C4BC-BEB7-18EB28E3F290}</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.9\build\native\grpc.dependencies.zlib.redist.targets" Condition="Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\native\grpc.dependencies\grpc.dependencies.zlib.targets')" />
<Import Project="..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.9\build\native\grpc.dependencies.zlib.targets" Condition="Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.9\build\native\grpc.dependencies\grpc.dependencies.zlib.targets')" />
<Import Project="..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.2.3\build\native\grpc.dependencies.openssl.redist.targets" Condition="Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.2.3\build\native\grpc.dependencies\grpc.dependencies.openssl.targets')" />
<Import Project="..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.2.3\build\native\grpc.dependencies.openssl.targets" Condition="Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.2.3\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.9\build\native\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\native\grpc.dependencies.zlib.redist.targets')" />
<Error Condition="!Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.9\build\native\grpc.dependencies.zlib.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.9\build\native\grpc.dependencies.zlib.targets')" />
<Error Condition="!Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.2.3\build\native\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.2.3\build\native\grpc.dependencies.openssl.redist.targets')" />
<Error Condition="!Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.2.3\build\native\grpc.dependencies.openssl.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.2.3\build\native\grpc.dependencies.openssl.props')" />
<Error Condition="!Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.2.3\build\native\grpc.dependencies.openssl.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.2.3\build\native\grpc.dependencies.openssl.targets')" />
</Target>
</Project>

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\..\..\test\proto\metrics.proto">
<Filter>test\proto</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\test\cpp\interop\metrics_client.cc">
<Filter>test\cpp\interop</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\test\cpp\util\metrics_server.h">
<Filter>test\cpp\util</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="test">
<UniqueIdentifier>{2c00b6b1-865c-55b2-0d9d-8d7b42ad7d03}</UniqueIdentifier>
</Filter>
<Filter Include="test\cpp">
<UniqueIdentifier>{a62a5921-b3d4-6069-e9cc-73f34609c99b}</UniqueIdentifier>
</Filter>
<Filter Include="test\cpp\interop">
<UniqueIdentifier>{fbd5c6ac-f3a9-1b16-6310-c205aadc9075}</UniqueIdentifier>
</Filter>
<Filter Include="test\cpp\util">
<UniqueIdentifier>{16f4e45d-a509-3e4d-4a19-9383576bec54}</UniqueIdentifier>
</Filter>
<Filter Include="test\proto">
<UniqueIdentifier>{c638ed75-9aa0-ccc3-a8d2-a1a6203977b1}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

@ -148,6 +148,7 @@
<ClInclude Include="..\..\..\..\test\cpp\interop\client_helper.h" />
<ClInclude Include="..\..\..\..\test\cpp\interop\interop_client.h" />
<ClInclude Include="..\..\..\..\test\cpp\interop\stress_interop_client.h" />
<ClInclude Include="..\..\..\..\test\cpp\util\metrics_server.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\test\proto\empty.pb.cc">
@ -166,6 +167,14 @@
</ClCompile>
<ClInclude Include="..\..\..\..\test\proto\messages.grpc.pb.h">
</ClInclude>
<ClCompile Include="..\..\..\..\test\proto\metrics.pb.cc">
</ClCompile>
<ClInclude Include="..\..\..\..\test\proto\metrics.pb.h">
</ClInclude>
<ClCompile Include="..\..\..\..\test\proto\metrics.grpc.pb.cc">
</ClCompile>
<ClInclude Include="..\..\..\..\test\proto\metrics.grpc.pb.h">
</ClInclude>
<ClCompile Include="..\..\..\..\test\proto\test.pb.cc">
</ClCompile>
<ClInclude Include="..\..\..\..\test\proto\test.pb.h">
@ -180,6 +189,8 @@
</ClCompile>
<ClCompile Include="..\..\..\..\test\cpp\interop\stress_test.cc">
</ClCompile>
<ClCompile Include="..\..\..\..\test\cpp\util\metrics_server.cc">
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\vsprojects\vcxproj\.\grpc++_test_util\grpc++_test_util.vcxproj">

@ -7,6 +7,9 @@
<ClCompile Include="..\..\..\..\test\proto\messages.proto">
<Filter>test\proto</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\test\proto\metrics.proto">
<Filter>test\proto</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\test\proto\test.proto">
<Filter>test\proto</Filter>
</ClCompile>
@ -19,6 +22,9 @@
<ClCompile Include="..\..\..\..\test\cpp\interop\stress_test.cc">
<Filter>test\cpp\interop</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\test\cpp\util\metrics_server.cc">
<Filter>test\cpp\util</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\test\cpp\interop\client_helper.h">
@ -30,6 +36,9 @@
<ClInclude Include="..\..\..\..\test\cpp\interop\stress_interop_client.h">
<Filter>test\cpp\interop</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\test\cpp\util\metrics_server.h">
<Filter>test\cpp\util</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
@ -42,6 +51,9 @@
<Filter Include="test\cpp\interop">
<UniqueIdentifier>{7afcf5a8-556a-6be3-15d4-b00b2518f8fb}</UniqueIdentifier>
</Filter>
<Filter Include="test\cpp\util">
<UniqueIdentifier>{e4704307-621e-0e9c-08c2-3c698c1b827f}</UniqueIdentifier>
</Filter>
<Filter Include="test\proto">
<UniqueIdentifier>{7172a335-47bf-8284-380d-a28a05c07311}</UniqueIdentifier>
</Filter>

Loading…
Cancel
Save