blob: 848a4ad87eda07cfb951de86bc7f5db3959e93df [file] [log] [blame]
Jan Tattermusch7897ae92017-06-07 22:57:36 +02001# Copyright 2017 gRPC authors.
Craig Tiller3a488472017-02-17 14:35:26 -08002#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02003# 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
Craig Tiller3a488472017-02-17 14:35:26 -08006#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02007# http://www.apache.org/licenses/LICENSE-2.0
Craig Tiller3a488472017-02-17 14:35:26 -08008#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02009# 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.
Craig Tiller3a488472017-02-17 14:35:26 -080014
Jan Tattermusch4d5c3102017-06-07 10:23:56 +020015licenses(["notice"]) # Apache v2
Craig Tiller3a488472017-02-17 14:35:26 -080016
Nicolas "Pixel" Noble2bc5e3a2017-08-15 22:32:52 +020017load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library", "grpc_cc_binary", "grpc_package")
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020018
Nicolas "Pixel" Noble2bc5e3a2017-08-15 22:32:52 +020019grpc_package(name = "test/cpp/qps")
Nicolas "Pixel" Nobleaf6c83f2017-05-19 00:38:10 +020020
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020021grpc_cc_library(
Craig Tiller3a488472017-02-17 14:35:26 -080022 name = "parse_json",
Craig Tiller3a488472017-02-17 14:35:26 -080023 srcs = ["parse_json.cc"],
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010024 hdrs = ["parse_json.h"],
Nicolas "Pixel" Noble78f8ce32017-05-11 00:42:55 +020025 external_deps = ["protobuf"],
Bill Feng373c5b32018-08-20 10:55:49 -070026 deps = ["//:grpc++"],
Craig Tiller3a488472017-02-17 14:35:26 -080027)
28
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020029grpc_cc_library(
Craig Tiller3a488472017-02-17 14:35:26 -080030 name = "qps_worker_impl",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010031 srcs = [
32 "client_async.cc",
33 "client_sync.cc",
Bill Feng373c5b32018-08-20 10:55:49 -070034 "qps_server_builder.cc",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010035 "qps_worker.cc",
36 "server_async.cc",
37 "server_sync.cc",
38 ],
39 hdrs = [
40 "client.h",
Bill Feng373c5b32018-08-20 10:55:49 -070041 "qps_server_builder.h",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010042 "qps_worker.h",
43 "server.h",
Bill Feng373c5b32018-08-20 10:55:49 -070044 ],
45 external_deps = [
46 "gflags",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010047 ],
48 deps = [
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +010049 ":histogram",
50 ":interarrival",
51 ":usage_timer",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010052 "//:grpc",
53 "//:grpc++",
Craig Tillere1101cf2017-09-06 09:42:20 -070054 "//:grpc++_core_stats",
kpayson647a20c962018-04-18 15:19:55 -070055 "//src/proto/grpc/testing:benchmark_service_proto",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010056 "//src/proto/grpc/testing:control_proto",
57 "//src/proto/grpc/testing:payloads_proto",
kpayson647a20c962018-04-18 15:19:55 -070058 "//src/proto/grpc/testing:worker_service_proto",
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +010059 "//test/core/end2end:ssl_test_data",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010060 "//test/core/util:gpr_test_util",
61 "//test/core/util:grpc_test_util",
Alex Polcyn92e0a702018-07-21 07:38:34 +000062 "//test/cpp/util:test_config",
Bill Feng373c5b32018-08-20 10:55:49 -070063 "//test/cpp/util:test_util",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010064 ],
Craig Tiller3a488472017-02-17 14:35:26 -080065)
66
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020067grpc_cc_library(
Craig Tiller3a488472017-02-17 14:35:26 -080068 name = "driver_impl",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010069 srcs = [
70 "driver.cc",
71 "report.cc",
72 ],
73 hdrs = [
74 "driver.h",
75 "report.h",
76 ],
77 deps = [
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +010078 ":histogram",
79 ":parse_json",
80 ":qps_worker_impl",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010081 "//:grpc++",
82 "//src/proto/grpc/testing:control_proto",
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +010083 "//src/proto/grpc/testing:messages_proto",
kpayson647a20c962018-04-18 15:19:55 -070084 "//src/proto/grpc/testing:report_qps_scenario_service_proto",
85 "//src/proto/grpc/testing:worker_service_proto",
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +010086 "//test/core/util:gpr_test_util",
87 "//test/core/util:grpc_test_util",
Guantao Liuabe3cf52017-07-12 17:36:30 -070088 "//test/cpp/util:test_util",
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +010089 ],
90)
91
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020092grpc_cc_library(
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +010093 name = "benchmark_config",
94 srcs = [
95 "benchmark_config.cc",
96 ],
97 hdrs = [
98 "benchmark_config.h",
99 ],
Bill Feng373c5b32018-08-20 10:55:49 -0700100 external_deps = [
101 "gflags",
102 ],
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +0100103 deps = [
104 ":driver_impl",
105 ":histogram",
106 "//:grpc++",
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +0100107 "//src/proto/grpc/testing:control_proto",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100108 ],
Craig Tiller3a488472017-02-17 14:35:26 -0800109)
110
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +0200111grpc_cc_library(
Craig Tiller3a488472017-02-17 14:35:26 -0800112 name = "histogram",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100113 hdrs = [
114 "histogram.h",
115 "stats.h",
116 ],
Vijay Pai195cf1e2017-11-30 10:56:06 -0800117 deps = ["//test/core/util:grpc_test_util"],
Craig Tiller3a488472017-02-17 14:35:26 -0800118)
119
Vijay Pai088112f2017-08-24 10:42:27 -0700120grpc_cc_test(
121 name = "inproc_sync_unary_ping_pong_test",
122 srcs = ["inproc_sync_unary_ping_pong_test.cc"],
123 deps = [
124 ":benchmark_config",
125 ":driver_impl",
126 "//:grpc++",
127 "//test/cpp/util:test_config",
128 "//test/cpp/util:test_util",
129 ],
130)
131
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +0200132grpc_cc_library(
Craig Tiller3a488472017-02-17 14:35:26 -0800133 name = "interarrival",
134 hdrs = ["interarrival.h"],
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100135 deps = ["//:grpc++"],
Craig Tiller3a488472017-02-17 14:35:26 -0800136)
137
Bill Feng5be73042018-08-24 09:46:39 -0700138filegroup(
139 name = "json_run_localhost_scenarios",
140 srcs = [
141 ":json_run_localhost_scenarios.json",
142 ],
143)
144
Bill Feng373c5b32018-08-20 10:55:49 -0700145grpc_cc_test(
Craig Tiller3a488472017-02-17 14:35:26 -0800146 name = "json_run_localhost",
147 srcs = ["json_run_localhost.cc"],
Bill Feng373c5b32018-08-20 10:55:49 -0700148 args = [
Bill Feng5be73042018-08-24 09:46:39 -0700149 "--scenarios_file",
150 "$(location //test/cpp/qps:json_run_localhost_scenarios)",
151 ],
152 data = [
153 "//test/cpp/qps:json_run_localhost_scenarios",
154 "//test/cpp/qps:qps_json_driver",
155 "//test/cpp/qps:qps_worker",
Bill Feng373c5b32018-08-20 10:55:49 -0700156 ],
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100157 deps = [
158 "//:gpr",
159 "//test/core/util:gpr_test_util",
160 "//test/core/util:grpc_test_util",
yang-gb575a342017-07-13 09:47:27 -0700161 "//test/cpp/util:test_config",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100162 "//test/cpp/util:test_util",
163 ],
Craig Tiller3a488472017-02-17 14:35:26 -0800164)
165
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +0200166grpc_cc_test(
Craig Tiller3a488472017-02-17 14:35:26 -0800167 name = "qps_interarrival_test",
168 srcs = ["qps_interarrival_test.cc"],
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100169 deps = [
170 ":histogram",
171 ":interarrival",
yang-gb575a342017-07-13 09:47:27 -0700172 "//test/cpp/util:test_config",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100173 ],
Craig Tiller3a488472017-02-17 14:35:26 -0800174)
175
Bill Feng5be73042018-08-24 09:46:39 -0700176filegroup(
177 name = "qps_json_driver_scenarios",
178 srcs = [
179 ":qps_json_driver_scenarios.json",
180 ],
181)
182
Bill Feng373c5b32018-08-20 10:55:49 -0700183grpc_cc_test(
Craig Tiller3a488472017-02-17 14:35:26 -0800184 name = "qps_json_driver",
185 srcs = ["qps_json_driver.cc"],
Bill Feng373c5b32018-08-20 10:55:49 -0700186 args = [
187 "--run_inproc",
Bill Feng5be73042018-08-24 09:46:39 -0700188 "--scenarios_file",
189 "$(location //test/cpp/qps:qps_json_driver_scenarios)",
190 ],
191 data = [
192 "//test/cpp/qps:qps_json_driver_scenarios",
Bill Feng373c5b32018-08-20 10:55:49 -0700193 ],
194 external_deps = [
195 "gflags",
196 ],
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100197 deps = [
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +0100198 ":benchmark_config",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100199 ":driver_impl",
200 "//:grpc++",
Guantao Liuabe3cf52017-07-12 17:36:30 -0700201 "//test/cpp/util:test_config",
Guantao Liuac9fdfb2017-07-14 17:33:19 -0700202 "//test/cpp/util:test_util",
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +0200203 ],
Craig Tiller3a488472017-02-17 14:35:26 -0800204)
205
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +0200206grpc_cc_test(
Craig Tiller3a488472017-02-17 14:35:26 -0800207 name = "qps_openloop_test",
208 srcs = ["qps_openloop_test.cc"],
Bill Feng373c5b32018-08-20 10:55:49 -0700209 data = ["//third_party/toolchains:RBE_USE_MACHINE_TYPE_LARGE"],
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100210 deps = [
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +0100211 ":benchmark_config",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100212 ":driver_impl",
213 ":qps_worker_impl",
yang-gb575a342017-07-13 09:47:27 -0700214 "//test/cpp/util:test_config",
Guantao Liuac9fdfb2017-07-14 17:33:19 -0700215 "//test/cpp/util:test_util",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100216 ],
Craig Tiller3a488472017-02-17 14:35:26 -0800217)
218
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +0200219grpc_cc_test(
Craig Tiller3a488472017-02-17 14:35:26 -0800220 name = "secure_sync_unary_ping_pong_test",
221 srcs = ["secure_sync_unary_ping_pong_test.cc"],
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100222 deps = [
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +0100223 ":benchmark_config",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100224 ":driver_impl",
225 "//:grpc++",
yang-gb575a342017-07-13 09:47:27 -0700226 "//test/cpp/util:test_config",
Guantao Liuac9fdfb2017-07-14 17:33:19 -0700227 "//test/cpp/util:test_util",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100228 ],
Craig Tiller3a488472017-02-17 14:35:26 -0800229)
230
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +0200231grpc_cc_library(
Craig Tiller3a488472017-02-17 14:35:26 -0800232 name = "usage_timer",
233 srcs = ["usage_timer.cc"],
234 hdrs = ["usage_timer.h"],
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100235 deps = ["//:gpr"],
Craig Tiller3a488472017-02-17 14:35:26 -0800236)
237
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +0200238grpc_cc_binary(
Craig Tiller3a488472017-02-17 14:35:26 -0800239 name = "qps_worker",
240 srcs = ["worker.cc"],
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100241 deps = [
242 ":qps_worker_impl",
243 "//:grpc++",
244 "//test/core/util:gpr_test_util",
245 "//test/core/util:grpc_test_util",
246 "//test/cpp/util:test_config",
247 "//test/cpp/util:test_util",
248 ],
Craig Tiller3a488472017-02-17 14:35:26 -0800249)