Imported Upstream version 1.34.0
[platform/upstream/grpc.git] / test / cpp / qps / BUILD
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
15 licenses(["notice"])  # Apache v2
16
17 load("//bazel:grpc_build_system.bzl", "grpc_cc_binary", "grpc_cc_library", "grpc_cc_test", "grpc_package")
18 load("//test/cpp/qps:qps_benchmark_script.bzl", "json_run_localhost_batch", "qps_json_driver_batch")
19 load("//bazel:custom_exec_properties.bzl", "LARGE_MACHINE")
20
21 grpc_package(name = "test/cpp/qps")
22
23 grpc_cc_library(
24     name = "parse_json",
25     srcs = ["parse_json.cc"],
26     hdrs = ["parse_json.h"],
27     external_deps = ["protobuf"],
28     deps = ["//:grpc++"],
29 )
30
31 grpc_cc_library(
32     name = "qps_worker_impl",
33     srcs = [
34         "client_async.cc",
35         "client_callback.cc",
36         "client_sync.cc",
37         "qps_server_builder.cc",
38         "qps_worker.cc",
39         "server_async.cc",
40         "server_callback.cc",
41         "server_sync.cc",
42     ],
43     hdrs = [
44         "client.h",
45         "qps_server_builder.h",
46         "qps_worker.h",
47         "server.h",
48     ],
49     deps = [
50         ":histogram",
51         ":interarrival",
52         ":usage_timer",
53         "//:grpc",
54         "//:grpc++",
55         "//:grpc++_core_stats",
56         "//src/proto/grpc/testing:benchmark_service_proto",
57         "//src/proto/grpc/testing:control_proto",
58         "//src/proto/grpc/testing:payloads_proto",
59         "//src/proto/grpc/testing:worker_service_proto",
60         "//test/core/end2end:ssl_test_data",
61         "//test/core/util:grpc_test_util",
62         "//test/cpp/util:test_config",
63         "//test/cpp/util:test_util",
64     ],
65 )
66
67 grpc_cc_library(
68     name = "driver_impl",
69     srcs = [
70         "driver.cc",
71         "report.cc",
72     ],
73     hdrs = [
74         "driver.h",
75         "report.h",
76     ],
77     deps = [
78         ":histogram",
79         ":parse_json",
80         ":qps_worker_impl",
81         "//:grpc++",
82         "//src/proto/grpc/testing:control_proto",
83         "//src/proto/grpc/testing:messages_proto",
84         "//src/proto/grpc/testing:report_qps_scenario_service_proto",
85         "//src/proto/grpc/testing:worker_service_proto",
86         "//test/core/util:grpc_test_util",
87         "//test/cpp/util:test_util",
88     ],
89 )
90
91 grpc_cc_library(
92     name = "benchmark_config",
93     srcs = [
94         "benchmark_config.cc",
95     ],
96     hdrs = [
97         "benchmark_config.h",
98     ],
99     external_deps = [
100         "absl/flags:flag",
101     ],
102     deps = [
103         ":driver_impl",
104         ":histogram",
105         "//:grpc++",
106         "//src/proto/grpc/testing:control_proto",
107     ],
108 )
109
110 grpc_cc_library(
111     name = "histogram",
112     hdrs = [
113         "histogram.h",
114         "stats.h",
115     ],
116     deps = [
117         "//src/proto/grpc/testing:stats_proto",
118         "//test/core/util:grpc_test_util",
119     ],
120 )
121
122 grpc_cc_binary(
123     name = "qps_json_driver",
124     srcs = ["qps_json_driver.cc"],
125     external_deps = [
126         "absl/flags:flag",
127     ],
128     deps = [
129         ":benchmark_config",
130         ":driver_impl",
131         "//:grpc++",
132         "//test/cpp/util:test_config",
133         "//test/cpp/util:test_util",
134     ],
135 )
136
137 grpc_cc_test(
138     name = "inproc_sync_unary_ping_pong_test",
139     srcs = ["inproc_sync_unary_ping_pong_test.cc"],
140     deps = [
141         ":benchmark_config",
142         ":driver_impl",
143         "//:grpc++",
144         "//test/cpp/util:test_config",
145         "//test/cpp/util:test_util",
146     ],
147 )
148
149 grpc_cc_library(
150     name = "interarrival",
151     hdrs = ["interarrival.h"],
152     deps = ["//:grpc++"],
153 )
154
155 qps_json_driver_batch()
156
157 json_run_localhost_batch()
158
159 grpc_cc_test(
160     name = "qps_interarrival_test",
161     srcs = ["qps_interarrival_test.cc"],
162     uses_polling = False,
163     deps = [
164         ":histogram",
165         ":interarrival",
166         "//test/cpp/util:test_config",
167     ],
168 )
169
170 grpc_cc_test(
171     name = "qps_openloop_test",
172     srcs = ["qps_openloop_test.cc"],
173     exec_properties = LARGE_MACHINE,
174     tags = ["no_windows"],  # LARGE_MACHINE is not configured for windows RBE
175     deps = [
176         ":benchmark_config",
177         ":driver_impl",
178         ":qps_worker_impl",
179         "//test/cpp/util:test_config",
180         "//test/cpp/util:test_util",
181     ],
182 )
183
184 grpc_cc_test(
185     name = "secure_sync_unary_ping_pong_test",
186     srcs = ["secure_sync_unary_ping_pong_test.cc"],
187     deps = [
188         ":benchmark_config",
189         ":driver_impl",
190         "//:grpc++",
191         "//test/cpp/util:test_config",
192         "//test/cpp/util:test_util",
193     ],
194 )
195
196 grpc_cc_library(
197     name = "usage_timer",
198     srcs = ["usage_timer.cc"],
199     hdrs = ["usage_timer.h"],
200     deps = ["//:gpr"],
201 )
202
203 grpc_cc_binary(
204     name = "qps_worker",
205     srcs = ["worker.cc"],
206     external_deps = [
207         "absl/flags:flag",
208     ],
209     deps = [
210         ":qps_worker_impl",
211         "//:grpc++",
212         "//test/core/util:grpc_test_util",
213         "//test/cpp/util:test_config",
214         "//test/cpp/util:test_util",
215     ],
216 )