BUILD 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. # Copyright 2017 gRPC authors.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. load("//bazel:grpc_build_system.bzl", "grpc_cc_binary", "grpc_cc_library", "grpc_cc_test", "grpc_package")
  15. load("//test/cpp/qps:qps_benchmark_script.bzl", "json_run_localhost_batch", "qps_json_driver_batch")
  16. load("//bazel:custom_exec_properties.bzl", "LARGE_MACHINE")
  17. licenses(["notice"])
  18. grpc_package(name = "test/cpp/qps")
  19. grpc_cc_library(
  20. name = "parse_json",
  21. srcs = ["parse_json.cc"],
  22. hdrs = ["parse_json.h"],
  23. external_deps = ["protobuf"],
  24. deps = ["//:grpc++"],
  25. )
  26. grpc_cc_library(
  27. name = "qps_worker_impl",
  28. srcs = [
  29. "client_async.cc",
  30. "client_callback.cc",
  31. "client_sync.cc",
  32. "qps_server_builder.cc",
  33. "qps_worker.cc",
  34. "server_async.cc",
  35. "server_callback.cc",
  36. "server_sync.cc",
  37. ],
  38. hdrs = [
  39. "client.h",
  40. "qps_server_builder.h",
  41. "qps_worker.h",
  42. "server.h",
  43. ],
  44. deps = [
  45. ":histogram",
  46. ":interarrival",
  47. ":usage_timer",
  48. "//:grpc",
  49. "//:grpc++",
  50. "//:grpc++_core_stats",
  51. "//src/proto/grpc/testing:benchmark_service_proto",
  52. "//src/proto/grpc/testing:control_proto",
  53. "//src/proto/grpc/testing:payloads_proto",
  54. "//src/proto/grpc/testing:worker_service_proto",
  55. "//test/core/end2end:ssl_test_data",
  56. "//test/core/util:grpc_test_util",
  57. "//test/cpp/util:test_config",
  58. "//test/cpp/util:test_util",
  59. ],
  60. )
  61. grpc_cc_library(
  62. name = "driver_impl",
  63. srcs = [
  64. "driver.cc",
  65. "report.cc",
  66. ],
  67. hdrs = [
  68. "driver.h",
  69. "report.h",
  70. ],
  71. deps = [
  72. ":histogram",
  73. ":parse_json",
  74. ":qps_worker_impl",
  75. "//:grpc++",
  76. "//src/proto/grpc/testing:control_proto",
  77. "//src/proto/grpc/testing:messages_proto",
  78. "//src/proto/grpc/testing:report_qps_scenario_service_proto",
  79. "//src/proto/grpc/testing:worker_service_proto",
  80. "//test/core/util:grpc_test_util",
  81. "//test/cpp/util:test_util",
  82. ],
  83. )
  84. grpc_cc_library(
  85. name = "benchmark_config",
  86. srcs = [
  87. "benchmark_config.cc",
  88. ],
  89. hdrs = [
  90. "benchmark_config.h",
  91. ],
  92. external_deps = [
  93. "absl/flags:flag",
  94. ],
  95. deps = [
  96. ":driver_impl",
  97. ":histogram",
  98. "//:grpc++",
  99. "//src/proto/grpc/testing:control_proto",
  100. ],
  101. )
  102. grpc_cc_library(
  103. name = "histogram",
  104. hdrs = [
  105. "histogram.h",
  106. "stats.h",
  107. ],
  108. deps = [
  109. "//src/proto/grpc/testing:stats_proto",
  110. "//test/core/util:grpc_test_util",
  111. ],
  112. )
  113. grpc_cc_binary(
  114. name = "qps_json_driver",
  115. srcs = ["qps_json_driver.cc"],
  116. external_deps = [
  117. "absl/flags:flag",
  118. ],
  119. deps = [
  120. ":benchmark_config",
  121. ":driver_impl",
  122. "//:grpc++",
  123. "//test/cpp/util:test_config",
  124. "//test/cpp/util:test_util",
  125. ],
  126. )
  127. grpc_cc_test(
  128. name = "inproc_sync_unary_ping_pong_test",
  129. srcs = ["inproc_sync_unary_ping_pong_test.cc"],
  130. deps = [
  131. ":benchmark_config",
  132. ":driver_impl",
  133. "//:grpc++",
  134. "//test/cpp/util:test_config",
  135. "//test/cpp/util:test_util",
  136. ],
  137. )
  138. grpc_cc_library(
  139. name = "interarrival",
  140. hdrs = ["interarrival.h"],
  141. deps = ["//:grpc++"],
  142. )
  143. qps_json_driver_batch()
  144. json_run_localhost_batch()
  145. grpc_cc_test(
  146. name = "qps_interarrival_test",
  147. srcs = ["qps_interarrival_test.cc"],
  148. uses_polling = False,
  149. deps = [
  150. ":histogram",
  151. ":interarrival",
  152. "//test/cpp/util:test_config",
  153. ],
  154. )
  155. grpc_cc_test(
  156. name = "qps_openloop_test",
  157. srcs = ["qps_openloop_test.cc"],
  158. exec_properties = LARGE_MACHINE,
  159. tags = ["no_windows"], # LARGE_MACHINE is not configured for windows RBE
  160. deps = [
  161. ":benchmark_config",
  162. ":driver_impl",
  163. ":qps_worker_impl",
  164. "//test/cpp/util:test_config",
  165. "//test/cpp/util:test_util",
  166. ],
  167. )
  168. grpc_cc_test(
  169. name = "secure_sync_unary_ping_pong_test",
  170. srcs = ["secure_sync_unary_ping_pong_test.cc"],
  171. deps = [
  172. ":benchmark_config",
  173. ":driver_impl",
  174. "//:grpc++",
  175. "//test/cpp/util:test_config",
  176. "//test/cpp/util:test_util",
  177. ],
  178. )
  179. grpc_cc_library(
  180. name = "usage_timer",
  181. srcs = ["usage_timer.cc"],
  182. hdrs = ["usage_timer.h"],
  183. deps = ["//:gpr"],
  184. )
  185. grpc_cc_binary(
  186. name = "qps_worker",
  187. srcs = ["worker.cc"],
  188. external_deps = [
  189. "absl/flags:flag",
  190. ],
  191. deps = [
  192. ":qps_worker_impl",
  193. "//:grpc++",
  194. "//test/core/util:grpc_test_util",
  195. "//test/cpp/util:test_config",
  196. "//test/cpp/util:test_util",
  197. ],
  198. )