Split qpstest.proto into two parts - one for performance stats and

one for control.
Eliminate the use of our own SimpleRequest and SimpleResponse and
instead share the one from end2end testing
reviewable/pr3905/r1
vjpai 9 years ago
parent 4c70baa1a1
commit 52bfb2564f
  1. 47
      Makefile
  2. 4
      build.yaml
  3. 2
      test/cpp/qps/client.h
  4. 2
      test/cpp/qps/client_async.cc
  5. 2
      test/cpp/qps/client_sync.cc
  6. 2
      test/cpp/qps/driver.cc
  7. 2
      test/cpp/qps/driver.h
  8. 2
      test/cpp/qps/histogram.h
  9. 2
      test/cpp/qps/perf_db.proto
  10. 2
      test/cpp/qps/qps_interarrival_test.cc
  11. 12
      test/cpp/qps/qps_worker.cc
  12. 1
      test/cpp/qps/report.h
  13. 2
      test/cpp/qps/server.h
  14. 2
      test/cpp/qps/server_async.cc
  15. 2
      test/cpp/qps/server_sync.cc
  16. 8
      tools/run_tests/sources_and_headers.json
  17. 24
      vsprojects/vcxproj/qps/qps.vcxproj
  18. 8
      vsprojects/vcxproj/qps/qps.vcxproj.filters

@ -3586,15 +3586,30 @@ $(GENDIR)/test/proto/messages.grpc.pb.cc: test/proto/messages.proto $(PROTOBUF_D
endif
ifeq ($(NO_PROTOC),true)
$(GENDIR)/test/proto/qpstest.pb.cc: protoc_dep_error
$(GENDIR)/test/proto/qpstest.grpc.pb.cc: protoc_dep_error
$(GENDIR)/test/proto/perf_control.pb.cc: protoc_dep_error
$(GENDIR)/test/proto/perf_control.grpc.pb.cc: protoc_dep_error
else
$(GENDIR)/test/proto/qpstest.pb.cc: test/proto/qpstest.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(GENDIR)/test/proto/perf_control.pb.cc: test/proto/perf_control.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) --cpp_out=$(GENDIR) $<
$(GENDIR)/test/proto/qpstest.grpc.pb.cc: test/proto/qpstest.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(GENDIR)/test/proto/perf_control.grpc.pb.cc: test/proto/perf_control.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[GRPC] Generating gRPC's protobuf service CC file from $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(BINDIR)/$(CONFIG)/grpc_cpp_plugin $<
endif
ifeq ($(NO_PROTOC),true)
$(GENDIR)/test/proto/perf_stats.pb.cc: protoc_dep_error
$(GENDIR)/test/proto/perf_stats.grpc.pb.cc: protoc_dep_error
else
$(GENDIR)/test/proto/perf_stats.pb.cc: test/proto/perf_stats.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) --cpp_out=$(GENDIR) $<
$(GENDIR)/test/proto/perf_stats.grpc.pb.cc: test/proto/perf_stats.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[GRPC] Generating gRPC's protobuf service CC file from $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(BINDIR)/$(CONFIG)/grpc_cpp_plugin $<
@ -5189,7 +5204,9 @@ $(OBJDIR)/$(CONFIG)/test/cpp/interop/server.o: $(GENDIR)/test/proto/empty.pb.cc
LIBQPS_SRC = \
$(GENDIR)/test/proto/qpstest.pb.cc $(GENDIR)/test/proto/qpstest.grpc.pb.cc \
$(GENDIR)/test/proto/messages.pb.cc $(GENDIR)/test/proto/messages.grpc.pb.cc \
$(GENDIR)/test/proto/perf_control.pb.cc $(GENDIR)/test/proto/perf_control.grpc.pb.cc \
$(GENDIR)/test/proto/perf_stats.pb.cc $(GENDIR)/test/proto/perf_stats.grpc.pb.cc \
$(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc \
test/cpp/qps/client_async.cc \
test/cpp/qps/client_sync.cc \
@ -5244,16 +5261,16 @@ ifneq ($(NO_DEPS),true)
-include $(LIBQPS_OBJS:.o=.dep)
endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_async.o: $(GENDIR)/test/proto/qpstest.pb.cc $(GENDIR)/test/proto/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_sync.o: $(GENDIR)/test/proto/qpstest.pb.cc $(GENDIR)/test/proto/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/driver.o: $(GENDIR)/test/proto/qpstest.pb.cc $(GENDIR)/test/proto/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/perf_db_client.o: $(GENDIR)/test/proto/qpstest.pb.cc $(GENDIR)/test/proto/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/qps_worker.o: $(GENDIR)/test/proto/qpstest.pb.cc $(GENDIR)/test/proto/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/report.o: $(GENDIR)/test/proto/qpstest.pb.cc $(GENDIR)/test/proto/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_async.o: $(GENDIR)/test/proto/qpstest.pb.cc $(GENDIR)/test/proto/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_sync.o: $(GENDIR)/test/proto/qpstest.pb.cc $(GENDIR)/test/proto/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/timer.o: $(GENDIR)/test/proto/qpstest.pb.cc $(GENDIR)/test/proto/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/util/benchmark_config.o: $(GENDIR)/test/proto/qpstest.pb.cc $(GENDIR)/test/proto/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_async.o: $(GENDIR)/test/proto/messages.pb.cc $(GENDIR)/test/proto/messages.grpc.pb.cc $(GENDIR)/test/proto/perf_control.pb.cc $(GENDIR)/test/proto/perf_control.grpc.pb.cc $(GENDIR)/test/proto/perf_stats.pb.cc $(GENDIR)/test/proto/perf_stats.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_sync.o: $(GENDIR)/test/proto/messages.pb.cc $(GENDIR)/test/proto/messages.grpc.pb.cc $(GENDIR)/test/proto/perf_control.pb.cc $(GENDIR)/test/proto/perf_control.grpc.pb.cc $(GENDIR)/test/proto/perf_stats.pb.cc $(GENDIR)/test/proto/perf_stats.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/driver.o: $(GENDIR)/test/proto/messages.pb.cc $(GENDIR)/test/proto/messages.grpc.pb.cc $(GENDIR)/test/proto/perf_control.pb.cc $(GENDIR)/test/proto/perf_control.grpc.pb.cc $(GENDIR)/test/proto/perf_stats.pb.cc $(GENDIR)/test/proto/perf_stats.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/perf_db_client.o: $(GENDIR)/test/proto/messages.pb.cc $(GENDIR)/test/proto/messages.grpc.pb.cc $(GENDIR)/test/proto/perf_control.pb.cc $(GENDIR)/test/proto/perf_control.grpc.pb.cc $(GENDIR)/test/proto/perf_stats.pb.cc $(GENDIR)/test/proto/perf_stats.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/qps_worker.o: $(GENDIR)/test/proto/messages.pb.cc $(GENDIR)/test/proto/messages.grpc.pb.cc $(GENDIR)/test/proto/perf_control.pb.cc $(GENDIR)/test/proto/perf_control.grpc.pb.cc $(GENDIR)/test/proto/perf_stats.pb.cc $(GENDIR)/test/proto/perf_stats.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/report.o: $(GENDIR)/test/proto/messages.pb.cc $(GENDIR)/test/proto/messages.grpc.pb.cc $(GENDIR)/test/proto/perf_control.pb.cc $(GENDIR)/test/proto/perf_control.grpc.pb.cc $(GENDIR)/test/proto/perf_stats.pb.cc $(GENDIR)/test/proto/perf_stats.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_async.o: $(GENDIR)/test/proto/messages.pb.cc $(GENDIR)/test/proto/messages.grpc.pb.cc $(GENDIR)/test/proto/perf_control.pb.cc $(GENDIR)/test/proto/perf_control.grpc.pb.cc $(GENDIR)/test/proto/perf_stats.pb.cc $(GENDIR)/test/proto/perf_stats.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_sync.o: $(GENDIR)/test/proto/messages.pb.cc $(GENDIR)/test/proto/messages.grpc.pb.cc $(GENDIR)/test/proto/perf_control.pb.cc $(GENDIR)/test/proto/perf_control.grpc.pb.cc $(GENDIR)/test/proto/perf_stats.pb.cc $(GENDIR)/test/proto/perf_stats.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/timer.o: $(GENDIR)/test/proto/messages.pb.cc $(GENDIR)/test/proto/messages.grpc.pb.cc $(GENDIR)/test/proto/perf_control.pb.cc $(GENDIR)/test/proto/perf_control.grpc.pb.cc $(GENDIR)/test/proto/perf_stats.pb.cc $(GENDIR)/test/proto/perf_stats.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/util/benchmark_config.o: $(GENDIR)/test/proto/messages.pb.cc $(GENDIR)/test/proto/messages.grpc.pb.cc $(GENDIR)/test/proto/perf_control.pb.cc $(GENDIR)/test/proto/perf_control.grpc.pb.cc $(GENDIR)/test/proto/perf_stats.pb.cc $(GENDIR)/test/proto/perf_stats.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
LIBGRPC_CSHARP_EXT_SRC = \

@ -749,7 +749,9 @@ libs:
- test/cpp/qps/timer.h
- test/cpp/util/benchmark_config.h
src:
- test/proto/qpstest.proto
- test/proto/messages.proto
- test/proto/perf_control.proto
- test/proto/perf_stats.proto
- test/cpp/qps/perf_db.proto
- test/cpp/qps/client_async.cc
- test/cpp/qps/client_sync.cc

@ -40,7 +40,7 @@
#include "test/cpp/qps/histogram.h"
#include "test/cpp/qps/interarrival.h"
#include "test/cpp/qps/timer.h"
#include "test/proto/qpstest.grpc.pb.h"
#include "test/proto/perf_control.grpc.pb.h"
#include "test/cpp/util/create_test_channel.h"
namespace grpc {

@ -48,7 +48,7 @@
#include <gflags/gflags.h>
#include <grpc++/client_context.h>
#include "test/proto/qpstest.grpc.pb.h"
#include "test/proto/perf_control.grpc.pb.h"
#include "test/cpp/qps/timer.h"
#include "test/cpp/qps/client.h"
#include "test/cpp/util/create_test_channel.h"

@ -54,7 +54,7 @@
#include "test/cpp/util/create_test_channel.h"
#include "test/cpp/qps/client.h"
#include "test/proto/qpstest.grpc.pb.h"
#include "test/proto/perf_control.grpc.pb.h"
#include "test/cpp/qps/histogram.h"
#include "test/cpp/qps/interarrival.h"
#include "test/cpp/qps/timer.h"

@ -196,7 +196,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
result_client_config.set_host(workers[i + num_servers]);
*args.mutable_setup() = client_config;
clients[i].stream =
clients[i].stub->RunTest(runsc::AllocContext(&contexts, deadline));
clients[i].stub->RunClient(runsc::AllocContext(&contexts, deadline));
GPR_ASSERT(clients[i].stream->Write(args));
ClientStatus init_status;
GPR_ASSERT(clients[i].stream->Read(&init_status));

@ -37,7 +37,7 @@
#include <memory>
#include "test/cpp/qps/histogram.h"
#include "test/proto/qpstest.grpc.pb.h"
#include "test/proto/perf_control.grpc.pb.h"
namespace grpc {
namespace testing {

@ -35,7 +35,7 @@
#define TEST_QPS_HISTOGRAM_H
#include <grpc/support/histogram.h>
#include "test/proto/qpstest.grpc.pb.h"
#include "test/proto/perf_stats.grpc.pb.h"
namespace grpc {
namespace testing {

@ -29,7 +29,7 @@
syntax = "proto3";
import "test/proto/qpstest.proto";
import "test/proto/perf_control.proto";
package grpc.testing;

@ -42,7 +42,7 @@
using grpc::testing::RandomDist;
using grpc::testing::InterarrivalTimer;
void RunTest(RandomDist &&r, int threads, std::string title) {
static void RunTest(RandomDist &&r, int threads, std::string title) {
InterarrivalTimer timer;
timer.init(r, threads);
gpr_histogram *h(gpr_histogram_create(0.01, 60e9));

@ -52,7 +52,7 @@
#include <grpc++/security/server_credentials.h>
#include "test/core/util/grpc_profiler.h"
#include "test/proto/qpstest.pb.h"
#include "test/proto/perf_control.pb.h"
#include "test/cpp/qps/client.h"
#include "test/cpp/qps/server.h"
#include "test/cpp/util/create_test_channel.h"
@ -94,8 +94,8 @@ class WorkerImpl GRPC_FINAL : public Worker::Service {
explicit WorkerImpl(int server_port)
: server_port_(server_port), acquired_(false) {}
Status RunTest(ServerContext* ctx,
ServerReaderWriter<ClientStatus, ClientArgs>* stream)
Status RunClient(ServerContext* ctx,
ServerReaderWriter<ClientStatus, ClientArgs>* stream)
GRPC_OVERRIDE {
InstanceGuard g(this);
if (!g.Acquired()) {
@ -103,7 +103,7 @@ class WorkerImpl GRPC_FINAL : public Worker::Service {
}
grpc_profiler_start("qps_client.prof");
Status ret = RunTestBody(ctx, stream);
Status ret = RunClientBody(ctx, stream);
grpc_profiler_stop();
return ret;
}
@ -154,8 +154,8 @@ class WorkerImpl GRPC_FINAL : public Worker::Service {
acquired_ = false;
}
Status RunTestBody(ServerContext* ctx,
ServerReaderWriter<ClientStatus, ClientArgs>* stream) {
Status RunClientBody(ServerContext* ctx,
ServerReaderWriter<ClientStatus, ClientArgs>* stream) {
ClientArgs args;
if (!stream->Read(&args)) {
return Status(StatusCode::INVALID_ARGUMENT, "");

@ -41,7 +41,6 @@
#include <grpc++/support/config.h>
#include "test/cpp/qps/driver.h"
#include "test/proto/qpstest.grpc.pb.h"
#include "test/cpp/qps/perf_db_client.h"
namespace grpc {

@ -35,7 +35,7 @@
#define TEST_QPS_SERVER_H
#include "test/cpp/qps/timer.h"
#include "test/proto/qpstest.grpc.pb.h"
#include "test/proto/perf_control.grpc.pb.h"
namespace grpc {
namespace testing {

@ -49,7 +49,7 @@
#include <grpc++/security/server_credentials.h>
#include <gtest/gtest.h>
#include "test/proto/qpstest.grpc.pb.h"
#include "test/proto/perf_control.grpc.pb.h"
#include "test/cpp/qps/server.h"
namespace grpc {

@ -43,7 +43,7 @@
#include <grpc++/server_context.h>
#include <grpc++/security/server_credentials.h>
#include "test/proto/qpstest.grpc.pb.h"
#include "test/proto/perf_control.grpc.pb.h"
#include "test/cpp/qps/server.h"
#include "test/cpp/qps/timer.h"

@ -13656,8 +13656,12 @@
"test/cpp/qps/stats.h",
"test/cpp/qps/timer.h",
"test/cpp/util/benchmark_config.h",
"test/proto/qpstest.grpc.pb.h",
"test/proto/qpstest.pb.h"
"test/proto/messages.grpc.pb.h",
"test/proto/messages.pb.h",
"test/proto/perf_control.grpc.pb.h",
"test/proto/perf_control.pb.h",
"test/proto/perf_stats.grpc.pb.h",
"test/proto/perf_stats.pb.h"
],
"language": "c++",
"name": "qps",

@ -147,13 +147,29 @@
<ClInclude Include="..\..\..\test\cpp\util\benchmark_config.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\test\proto\qpstest.pb.cc">
<ClCompile Include="..\..\..\test\proto\messages.pb.cc">
</ClCompile>
<ClInclude Include="..\..\..\test\proto\qpstest.pb.h">
<ClInclude Include="..\..\..\test\proto\messages.pb.h">
</ClInclude>
<ClCompile Include="..\..\..\test\proto\qpstest.grpc.pb.cc">
<ClCompile Include="..\..\..\test\proto\messages.grpc.pb.cc">
</ClCompile>
<ClInclude Include="..\..\..\test\proto\qpstest.grpc.pb.h">
<ClInclude Include="..\..\..\test\proto\messages.grpc.pb.h">
</ClInclude>
<ClCompile Include="..\..\..\test\proto\perf_control.pb.cc">
</ClCompile>
<ClInclude Include="..\..\..\test\proto\perf_control.pb.h">
</ClInclude>
<ClCompile Include="..\..\..\test\proto\perf_control.grpc.pb.cc">
</ClCompile>
<ClInclude Include="..\..\..\test\proto\perf_control.grpc.pb.h">
</ClInclude>
<ClCompile Include="..\..\..\test\proto\perf_stats.pb.cc">
</ClCompile>
<ClInclude Include="..\..\..\test\proto\perf_stats.pb.h">
</ClInclude>
<ClCompile Include="..\..\..\test\proto\perf_stats.grpc.pb.cc">
</ClCompile>
<ClInclude Include="..\..\..\test\proto\perf_stats.grpc.pb.h">
</ClInclude>
<ClCompile Include="..\..\..\test\cpp\qps\perf_db.pb.cc">
</ClCompile>

@ -1,7 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\..\test\proto\qpstest.proto">
<ClCompile Include="..\..\..\test\proto\messages.proto">
<Filter>test\proto</Filter>
</ClCompile>
<ClCompile Include="..\..\..\test\proto\perf_control.proto">
<Filter>test\proto</Filter>
</ClCompile>
<ClCompile Include="..\..\..\test\proto\perf_stats.proto">
<Filter>test\proto</Filter>
</ClCompile>
<ClCompile Include="..\..\..\test\cpp\qps\perf_db.proto">

Loading…
Cancel
Save