ff4ee9836c08505e2f359e91338aa1b4005dd210
[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     external_deps = [
50         "gflags",
51     ],
52     deps = [
53         ":histogram",
54         ":interarrival",
55         ":usage_timer",
56         "//:grpc",
57         "//:grpc++",
58         "//:grpc++_core_stats",
59         "//src/proto/grpc/testing:benchmark_service_proto",
60         "//src/proto/grpc/testing:control_proto",
61         "//src/proto/grpc/testing:payloads_proto",
62         "//src/proto/grpc/testing:worker_service_proto",
63         "//test/core/end2end:ssl_test_data",
64         "//test/core/util:grpc_test_util",
65         "//test/cpp/util:test_config",
66         "//test/cpp/util:test_util",
67     ],
68 )
69
70 grpc_cc_library(
71     name = "driver_impl",
72     srcs = [
73         "driver.cc",
74         "report.cc",
75     ],
76     hdrs = [
77         "driver.h",
78         "report.h",
79     ],
80     deps = [
81         ":histogram",
82         ":parse_json",
83         ":qps_worker_impl",
84         "//:grpc++",
85         "//src/proto/grpc/testing:control_proto",
86         "//src/proto/grpc/testing:messages_proto",
87         "//src/proto/grpc/testing:report_qps_scenario_service_proto",
88         "//src/proto/grpc/testing:worker_service_proto",
89         "//test/core/util:grpc_test_util",
90         "//test/cpp/util:test_util",
91     ],
92 )
93
94 grpc_cc_library(
95     name = "benchmark_config",
96     srcs = [
97         "benchmark_config.cc",
98     ],
99     hdrs = [
100         "benchmark_config.h",
101     ],
102     external_deps = [
103         "gflags",
104     ],
105     deps = [
106         ":driver_impl",
107         ":histogram",
108         "//:grpc++",
109         "//src/proto/grpc/testing:control_proto",
110     ],
111 )
112
113 grpc_cc_library(
114     name = "histogram",
115     hdrs = [
116         "histogram.h",
117         "stats.h",
118     ],
119     deps = ["//test/core/util:grpc_test_util"],
120 )
121
122 grpc_cc_binary(
123     name = "qps_json_driver",
124     srcs = ["qps_json_driver.cc"],
125     external_deps = [
126         "gflags",
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     deps = [
207         ":qps_worker_impl",
208         "//:grpc++",
209         "//test/core/util:grpc_test_util",
210         "//test/cpp/util:test_config",
211         "//test/cpp/util:test_util",
212     ],
213 )