blob: 483b29b1b3692b0a33a6bf6bf924b73c15912f18 [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")
Bill Feng21824af2018-08-27 15:30:52 -070018load("//test/cpp/qps:qps_benchmark_script.bzl", "qps_json_driver_batch", "json_run_localhost_batch")
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020019
Nicolas "Pixel" Noble2bc5e3a2017-08-15 22:32:52 +020020grpc_package(name = "test/cpp/qps")
Nicolas "Pixel" Nobleaf6c83f2017-05-19 00:38:10 +020021
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020022grpc_cc_library(
Craig Tiller3a488472017-02-17 14:35:26 -080023 name = "parse_json",
Craig Tiller3a488472017-02-17 14:35:26 -080024 srcs = ["parse_json.cc"],
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010025 hdrs = ["parse_json.h"],
Nicolas "Pixel" Noble78f8ce32017-05-11 00:42:55 +020026 external_deps = ["protobuf"],
Bill Feng373c5b32018-08-20 10:55:49 -070027 deps = ["//:grpc++"],
Craig Tiller3a488472017-02-17 14:35:26 -080028)
29
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020030grpc_cc_library(
Craig Tiller3a488472017-02-17 14:35:26 -080031 name = "qps_worker_impl",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010032 srcs = [
33 "client_async.cc",
34 "client_sync.cc",
Bill Feng373c5b32018-08-20 10:55:49 -070035 "qps_server_builder.cc",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010036 "qps_worker.cc",
37 "server_async.cc",
38 "server_sync.cc",
39 ],
40 hdrs = [
41 "client.h",
Bill Feng373c5b32018-08-20 10:55:49 -070042 "qps_server_builder.h",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010043 "qps_worker.h",
44 "server.h",
Bill Feng373c5b32018-08-20 10:55:49 -070045 ],
46 external_deps = [
47 "gflags",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010048 ],
49 deps = [
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +010050 ":histogram",
51 ":interarrival",
52 ":usage_timer",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010053 "//:grpc",
54 "//:grpc++",
Craig Tillere1101cf2017-09-06 09:42:20 -070055 "//:grpc++_core_stats",
kpayson647a20c962018-04-18 15:19:55 -070056 "//src/proto/grpc/testing:benchmark_service_proto",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010057 "//src/proto/grpc/testing:control_proto",
58 "//src/proto/grpc/testing:payloads_proto",
kpayson647a20c962018-04-18 15:19:55 -070059 "//src/proto/grpc/testing:worker_service_proto",
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +010060 "//test/core/end2end:ssl_test_data",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010061 "//test/core/util:gpr_test_util",
62 "//test/core/util:grpc_test_util",
Alex Polcyn92e0a702018-07-21 07:38:34 +000063 "//test/cpp/util:test_config",
Bill Feng373c5b32018-08-20 10:55:49 -070064 "//test/cpp/util:test_util",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010065 ],
Craig Tiller3a488472017-02-17 14:35:26 -080066)
67
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020068grpc_cc_library(
Craig Tiller3a488472017-02-17 14:35:26 -080069 name = "driver_impl",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010070 srcs = [
71 "driver.cc",
72 "report.cc",
73 ],
74 hdrs = [
75 "driver.h",
76 "report.h",
77 ],
78 deps = [
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +010079 ":histogram",
80 ":parse_json",
81 ":qps_worker_impl",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +010082 "//:grpc++",
83 "//src/proto/grpc/testing:control_proto",
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +010084 "//src/proto/grpc/testing:messages_proto",
kpayson647a20c962018-04-18 15:19:55 -070085 "//src/proto/grpc/testing:report_qps_scenario_service_proto",
86 "//src/proto/grpc/testing:worker_service_proto",
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +010087 "//test/core/util:gpr_test_util",
88 "//test/core/util:grpc_test_util",
Guantao Liuabe3cf52017-07-12 17:36:30 -070089 "//test/cpp/util:test_util",
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +010090 ],
91)
92
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020093grpc_cc_library(
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +010094 name = "benchmark_config",
95 srcs = [
96 "benchmark_config.cc",
97 ],
98 hdrs = [
99 "benchmark_config.h",
100 ],
Bill Feng373c5b32018-08-20 10:55:49 -0700101 external_deps = [
102 "gflags",
103 ],
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +0100104 deps = [
105 ":driver_impl",
106 ":histogram",
107 "//:grpc++",
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +0100108 "//src/proto/grpc/testing:control_proto",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100109 ],
Craig Tiller3a488472017-02-17 14:35:26 -0800110)
111
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +0200112grpc_cc_library(
Craig Tiller3a488472017-02-17 14:35:26 -0800113 name = "histogram",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100114 hdrs = [
115 "histogram.h",
116 "stats.h",
117 ],
Vijay Pai195cf1e2017-11-30 10:56:06 -0800118 deps = ["//test/core/util:grpc_test_util"],
Craig Tiller3a488472017-02-17 14:35:26 -0800119)
120
Bill Feng21824af2018-08-27 15:30:52 -0700121grpc_cc_binary(
122 name = "qps_json_driver",
123 srcs = ["qps_json_driver.cc"],
124 external_deps = [
125 "gflags",
126 ],
127 deps = [
128 ":benchmark_config",
129 ":driver_impl",
130 "//:grpc++",
131 "//test/cpp/util:test_config",
132 "//test/cpp/util:test_util",
133 ],
134)
135
Vijay Pai088112f2017-08-24 10:42:27 -0700136grpc_cc_test(
137 name = "inproc_sync_unary_ping_pong_test",
138 srcs = ["inproc_sync_unary_ping_pong_test.cc"],
139 deps = [
140 ":benchmark_config",
141 ":driver_impl",
142 "//:grpc++",
143 "//test/cpp/util:test_config",
144 "//test/cpp/util:test_util",
145 ],
146)
147
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +0200148grpc_cc_library(
Craig Tiller3a488472017-02-17 14:35:26 -0800149 name = "interarrival",
150 hdrs = ["interarrival.h"],
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100151 deps = ["//:grpc++"],
Craig Tiller3a488472017-02-17 14:35:26 -0800152)
153
Bill Feng21824af2018-08-27 15:30:52 -0700154qps_json_driver_batch()
Bill Feng5be73042018-08-24 09:46:39 -0700155
Bill Feng21824af2018-08-27 15:30:52 -0700156json_run_localhost_batch()
Craig Tiller3a488472017-02-17 14:35:26 -0800157
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +0200158grpc_cc_test(
Craig Tiller3a488472017-02-17 14:35:26 -0800159 name = "qps_interarrival_test",
160 srcs = ["qps_interarrival_test.cc"],
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100161 deps = [
162 ":histogram",
163 ":interarrival",
yang-gb575a342017-07-13 09:47:27 -0700164 "//test/cpp/util:test_config",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100165 ],
Craig Tiller3a488472017-02-17 14:35:26 -0800166)
167
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +0200168grpc_cc_test(
Craig Tiller3a488472017-02-17 14:35:26 -0800169 name = "qps_openloop_test",
170 srcs = ["qps_openloop_test.cc"],
Bill Feng373c5b32018-08-20 10:55:49 -0700171 data = ["//third_party/toolchains:RBE_USE_MACHINE_TYPE_LARGE"],
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100172 deps = [
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +0100173 ":benchmark_config",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100174 ":driver_impl",
175 ":qps_worker_impl",
yang-gb575a342017-07-13 09:47:27 -0700176 "//test/cpp/util:test_config",
Guantao Liuac9fdfb2017-07-14 17:33:19 -0700177 "//test/cpp/util:test_util",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100178 ],
Craig Tiller3a488472017-02-17 14:35:26 -0800179)
180
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +0200181grpc_cc_test(
Craig Tiller3a488472017-02-17 14:35:26 -0800182 name = "secure_sync_unary_ping_pong_test",
183 srcs = ["secure_sync_unary_ping_pong_test.cc"],
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100184 deps = [
Nicolas "Pixel" Nobleb02dd012017-03-24 18:45:22 +0100185 ":benchmark_config",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100186 ":driver_impl",
187 "//:grpc++",
yang-gb575a342017-07-13 09:47:27 -0700188 "//test/cpp/util:test_config",
Guantao Liuac9fdfb2017-07-14 17:33:19 -0700189 "//test/cpp/util:test_util",
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100190 ],
Craig Tiller3a488472017-02-17 14:35:26 -0800191)
192
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +0200193grpc_cc_library(
Craig Tiller3a488472017-02-17 14:35:26 -0800194 name = "usage_timer",
195 srcs = ["usage_timer.cc"],
196 hdrs = ["usage_timer.h"],
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100197 deps = ["//:gpr"],
Craig Tiller3a488472017-02-17 14:35:26 -0800198)
199
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +0200200grpc_cc_binary(
Craig Tiller3a488472017-02-17 14:35:26 -0800201 name = "qps_worker",
202 srcs = ["worker.cc"],
Nicolas "Pixel" Noble0a6d30b2017-03-22 00:51:51 +0100203 deps = [
204 ":qps_worker_impl",
205 "//:grpc++",
206 "//test/core/util:gpr_test_util",
207 "//test/core/util:grpc_test_util",
208 "//test/cpp/util:test_config",
209 "//test/cpp/util:test_util",
210 ],
Craig Tiller3a488472017-02-17 14:35:26 -0800211)