Skip to content

Commit

Permalink
Fixing qps & benchmark.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasnoble committed Mar 24, 2017
1 parent ddab452 commit b02dd01
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 28 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3660,6 +3660,7 @@ add_library(qps
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/services.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/services.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/services.grpc.pb.h
test/cpp/qps/benchmark_config.cc
test/cpp/qps/client_async.cc
test/cpp/qps/client_sync.cc
test/cpp/qps/driver.cc
Expand All @@ -3669,7 +3670,6 @@ add_library(qps
test/cpp/qps/server_async.cc
test/cpp/qps/server_sync.cc
test/cpp/qps/usage_timer.cc
test/cpp/util/benchmark_config.cc
)

if(WIN32 AND MSVC)
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5494,6 +5494,7 @@ LIBQPS_SRC = \
$(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc \
$(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc \
$(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc \
test/cpp/qps/benchmark_config.cc \
test/cpp/qps/client_async.cc \
test/cpp/qps/client_sync.cc \
test/cpp/qps/driver.cc \
Expand All @@ -5503,7 +5504,6 @@ LIBQPS_SRC = \
test/cpp/qps/server_async.cc \
test/cpp/qps/server_sync.cc \
test/cpp/qps/usage_timer.cc \
test/cpp/util/benchmark_config.cc \

PUBLIC_HEADERS_CXX += \

Expand Down Expand Up @@ -5549,6 +5549,7 @@ ifneq ($(NO_DEPS),true)
-include $(LIBQPS_OBJS:.o=.dep)
endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/qps/benchmark_config.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_async.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_sync.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/driver.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc
Expand All @@ -5558,7 +5559,6 @@ $(OBJDIR)/$(CONFIG)/test/cpp/qps/report.o: $(GENDIR)/src/proto/grpc/testing/mess
$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_async.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_sync.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/usage_timer.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/util/benchmark_config.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc


LIBGRPC_CSHARP_EXT_SRC = \
Expand Down Expand Up @@ -18805,6 +18805,7 @@ test/cpp/interop/interop_server.cc: $(OPENSSL_DEP)
test/cpp/interop/interop_server_bootstrap.cc: $(OPENSSL_DEP)
test/cpp/interop/server_helper.cc: $(OPENSSL_DEP)
test/cpp/microbenchmarks/helpers.cc: $(OPENSSL_DEP)
test/cpp/qps/benchmark_config.cc: $(OPENSSL_DEP)
test/cpp/qps/client_async.cc: $(OPENSSL_DEP)
test/cpp/qps/client_sync.cc: $(OPENSSL_DEP)
test/cpp/qps/driver.cc: $(OPENSSL_DEP)
Expand All @@ -18814,7 +18815,6 @@ test/cpp/qps/report.cc: $(OPENSSL_DEP)
test/cpp/qps/server_async.cc: $(OPENSSL_DEP)
test/cpp/qps/server_sync.cc: $(OPENSSL_DEP)
test/cpp/qps/usage_timer.cc: $(OPENSSL_DEP)
test/cpp/util/benchmark_config.cc: $(OPENSSL_DEP)
test/cpp/util/byte_buffer_proto_helper.cc: $(OPENSSL_DEP)
test/cpp/util/cli_call.cc: $(OPENSSL_DEP)
test/cpp/util/cli_credentials.cc: $(OPENSSL_DEP)
Expand Down
4 changes: 2 additions & 2 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,7 @@ libs:
build: private
language: c++
headers:
- test/cpp/qps/benchmark_config.h
- test/cpp/qps/client.h
- test/cpp/qps/driver.h
- test/cpp/qps/histogram.h
Expand All @@ -1394,13 +1395,13 @@ libs:
- test/cpp/qps/server.h
- test/cpp/qps/stats.h
- test/cpp/qps/usage_timer.h
- test/cpp/util/benchmark_config.h
src:
- src/proto/grpc/testing/messages.proto
- src/proto/grpc/testing/payloads.proto
- src/proto/grpc/testing/stats.proto
- src/proto/grpc/testing/control.proto
- src/proto/grpc/testing/services.proto
- test/cpp/qps/benchmark_config.cc
- test/cpp/qps/client_async.cc
- test/cpp/qps/client_sync.cc
- test/cpp/qps/driver.cc
Expand All @@ -1410,7 +1411,6 @@ libs:
- test/cpp/qps/server_async.cc
- test/cpp/qps/server_sync.cc
- test/cpp/qps/usage_timer.cc
- test/cpp/util/benchmark_config.cc
deps:
- grpc_test_util
- grpc++_test_util
Expand Down
2 changes: 2 additions & 0 deletions test/cpp/microbenchmarks/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ cc_test(
name = "noop-benchmark",
srcs = ["noop-benchmark.cc"],
deps = ["//external:benchmark"],
linkopts = ["-pthread"],
)

cc_library(
name = "helpers",
srcs = ["helpers.cc"],
hdrs = ["helpers.h", "fullstack_fixtures.h", "fullstack_context_mutators.h"],
deps = ["//:grpc++", "//external:benchmark", "//test/core/util:grpc_test_util", "//src/proto/grpc/testing:echo_proto"],
linkopts = ["-pthread"],
)

cc_test(
Expand Down
33 changes: 33 additions & 0 deletions test/cpp/qps/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,19 @@ cc_library(
"server.h",
],
deps = [
":histogram",
":interarrival",
":usage_timer",
"//:grpc",
"//:grpc++",
"//external:gtest",
"//src/proto/grpc/testing:control_proto",
"//src/proto/grpc/testing:payloads_proto",
"//src/proto/grpc/testing:services_proto",
"//test/core/end2end:ssl_test_data",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
],
)

Expand All @@ -73,7 +78,31 @@ cc_library(
"report.h",
],
deps = [
":histogram",
":parse_json",
":qps_worker_impl",
"//:grpc++",
"//src/proto/grpc/testing:control_proto",
"//src/proto/grpc/testing:messages_proto",
"//src/proto/grpc/testing:services_proto",
"//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util",
],
)

cc_library(
name = "benchmark_config",
srcs = [
"benchmark_config.cc",
],
hdrs = [
"benchmark_config.h",
],
deps = [
":driver_impl",
":histogram",
"//:grpc++",
"//external:gflags",
"//src/proto/grpc/testing:control_proto",
],
)
Expand Down Expand Up @@ -117,15 +146,18 @@ cc_binary(
name = "qps_json_driver",
srcs = ["qps_json_driver.cc"],
deps = [
":benchmark_config",
":driver_impl",
"//:grpc++",
"//external:gflags",
],
)

cc_test(
name = "qps_openloop_test",
srcs = ["qps_openloop_test.cc"],
deps = [
":benchmark_config",
":driver_impl",
":qps_worker_impl",
],
Expand All @@ -135,6 +167,7 @@ cc_test(
name = "secure_sync_unary_ping_pong_test",
srcs = ["secure_sync_unary_ping_pong_test.cc"],
deps = [
":benchmark_config",
":driver_impl",
"//:grpc++",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*
*/

#include "test/cpp/util/benchmark_config.h"
#include "test/cpp/qps/benchmark_config.h"
#include <gflags/gflags.h>

DEFINE_bool(enable_log_reporter, true,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/cpp/qps/qps_json_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include "test/cpp/qps/driver.h"
#include "test/cpp/qps/parse_json.h"
#include "test/cpp/qps/report.h"
#include "test/cpp/util/benchmark_config.h"
#include "test/cpp/qps/benchmark_config.h"

DEFINE_string(scenarios_file, "",
"JSON file containing an array of Scenario objects");
Expand Down
2 changes: 1 addition & 1 deletion test/cpp/qps/qps_openloop_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "test/core/util/test_config.h"
#include "test/cpp/qps/driver.h"
#include "test/cpp/qps/report.h"
#include "test/cpp/util/benchmark_config.h"
#include "test/cpp/qps/benchmark_config.h"

namespace grpc {
namespace testing {
Expand Down
2 changes: 1 addition & 1 deletion test/cpp/qps/qps_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

#include "test/cpp/qps/driver.h"
#include "test/cpp/qps/report.h"
#include "test/cpp/util/benchmark_config.h"
#include "test/cpp/qps/benchmark_config.h"

namespace grpc {
namespace testing {
Expand Down
2 changes: 1 addition & 1 deletion test/cpp/qps/secure_sync_unary_ping_pong_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

#include "test/cpp/qps/driver.h"
#include "test/cpp/qps/report.h"
#include "test/cpp/util/benchmark_config.h"
#include "test/cpp/qps/benchmark_config.h"

namespace grpc {
namespace testing {
Expand Down
10 changes: 5 additions & 5 deletions tools/run_tests/generated/sources_and_headers.json
Original file line number Diff line number Diff line change
Expand Up @@ -6188,6 +6188,7 @@
"src/proto/grpc/testing/services.pb.h",
"src/proto/grpc/testing/stats.grpc.pb.h",
"src/proto/grpc/testing/stats.pb.h",
"test/cpp/qps/benchmark_config.h",
"test/cpp/qps/client.h",
"test/cpp/qps/driver.h",
"test/cpp/qps/histogram.h",
Expand All @@ -6197,13 +6198,14 @@
"test/cpp/qps/report.h",
"test/cpp/qps/server.h",
"test/cpp/qps/stats.h",
"test/cpp/qps/usage_timer.h",
"test/cpp/util/benchmark_config.h"
"test/cpp/qps/usage_timer.h"
],
"is_filegroup": false,
"language": "c++",
"name": "qps",
"src": [
"test/cpp/qps/benchmark_config.cc",
"test/cpp/qps/benchmark_config.h",
"test/cpp/qps/client.h",
"test/cpp/qps/client_async.cc",
"test/cpp/qps/client_sync.cc",
Expand All @@ -6222,9 +6224,7 @@
"test/cpp/qps/server_sync.cc",
"test/cpp/qps/stats.h",
"test/cpp/qps/usage_timer.cc",
"test/cpp/qps/usage_timer.h",
"test/cpp/util/benchmark_config.cc",
"test/cpp/util/benchmark_config.h"
"test/cpp/qps/usage_timer.h"
],
"third_party": false,
"type": "lib"
Expand Down
6 changes: 3 additions & 3 deletions vsprojects/vcxproj/qps/qps.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
</ItemDefinitionGroup>

<ItemGroup>
<ClInclude Include="$(SolutionDir)\..\test\cpp\qps\benchmark_config.h" />
<ClInclude Include="$(SolutionDir)\..\test\cpp\qps\client.h" />
<ClInclude Include="$(SolutionDir)\..\test\cpp\qps\driver.h" />
<ClInclude Include="$(SolutionDir)\..\test\cpp\qps\histogram.h" />
Expand All @@ -157,7 +158,6 @@
<ClInclude Include="$(SolutionDir)\..\test\cpp\qps\server.h" />
<ClInclude Include="$(SolutionDir)\..\test\cpp\qps\stats.h" />
<ClInclude Include="$(SolutionDir)\..\test\cpp\qps\usage_timer.h" />
<ClInclude Include="$(SolutionDir)\..\test\cpp\util\benchmark_config.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(SolutionDir)\..\src\proto\grpc\testing\messages.pb.cc">
Expand Down Expand Up @@ -200,6 +200,8 @@
</ClCompile>
<ClInclude Include="$(SolutionDir)\..\src\proto\grpc\testing\services.grpc.pb.h">
</ClInclude>
<ClCompile Include="$(SolutionDir)\..\test\cpp\qps\benchmark_config.cc">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\cpp\qps\client_async.cc">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\cpp\qps\client_sync.cc">
Expand All @@ -218,8 +220,6 @@
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\cpp\qps\usage_timer.cc">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\cpp\util\benchmark_config.cc">
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc_test_util\grpc_test_util.vcxproj">
Expand Down
15 changes: 6 additions & 9 deletions vsprojects/vcxproj/qps/qps.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
<ClCompile Include="$(SolutionDir)\..\src\proto\grpc\testing\services.proto">
<Filter>src\proto\grpc\testing</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\cpp\qps\benchmark_config.cc">
<Filter>test\cpp\qps</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\cpp\qps\client_async.cc">
<Filter>test\cpp\qps</Filter>
</ClCompile>
Expand Down Expand Up @@ -43,11 +46,11 @@
<ClCompile Include="$(SolutionDir)\..\test\cpp\qps\usage_timer.cc">
<Filter>test\cpp\qps</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\cpp\util\benchmark_config.cc">
<Filter>test\cpp\util</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(SolutionDir)\..\test\cpp\qps\benchmark_config.h">
<Filter>test\cpp\qps</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\test\cpp\qps\client.h">
<Filter>test\cpp\qps</Filter>
</ClInclude>
Expand Down Expand Up @@ -78,9 +81,6 @@
<ClInclude Include="$(SolutionDir)\..\test\cpp\qps\usage_timer.h">
<Filter>test\cpp\qps</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\test\cpp\util\benchmark_config.h">
<Filter>test\cpp\util</Filter>
</ClInclude>
</ItemGroup>

<ItemGroup>
Expand All @@ -105,9 +105,6 @@
<Filter Include="test\cpp\qps">
<UniqueIdentifier>{b57fa0e4-f88d-fe46-8885-956fc582de3d}</UniqueIdentifier>
</Filter>
<Filter Include="test\cpp\util">
<UniqueIdentifier>{9042d134-6d5a-a907-799e-01768a475055}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

0 comments on commit b02dd01

Please sign in to comment.