1# Copyright 2020 The 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 15load("@rules_python//python:defs.bzl", "py_binary", "py_library") 16 17package( 18 default_testonly = 1, 19 default_visibility = ["//visibility:public"], 20) 21 22py_library( 23 name = "histogram", 24 srcs = ["histogram.py"], 25 srcs_version = "PY2AND3", 26 deps = [ 27 "//src/proto/grpc/testing:stats_py_pb2", 28 ], 29) 30 31py_library( 32 name = "benchmark_client", 33 srcs = ["benchmark_client.py"], 34 srcs_version = "PY2AND3", 35 deps = [ 36 "//src/proto/grpc/testing:benchmark_service_py_pb2_grpc", 37 "//src/proto/grpc/testing:py_messages_proto", 38 "//src/python/grpcio/grpc:grpcio", 39 "//src/python/grpcio_tests/tests/unit:resources", 40 "//src/python/grpcio_tests/tests/unit:test_common", 41 ], 42) 43 44py_library( 45 name = "benchmark_server", 46 srcs = ["benchmark_server.py"], 47 srcs_version = "PY2AND3", 48 deps = [ 49 "//src/proto/grpc/testing:benchmark_service_py_pb2_grpc", 50 "//src/proto/grpc/testing:py_messages_proto", 51 ], 52) 53 54py_library( 55 name = "client_runner", 56 srcs = ["client_runner.py"], 57 srcs_version = "PY2AND3", 58) 59 60py_library( 61 name = "worker_server", 62 srcs = ["worker_server.py"], 63 srcs_version = "PY2AND3", 64 deps = [ 65 ":benchmark_client", 66 ":benchmark_server", 67 ":client_runner", 68 ":histogram", 69 "//src/proto/grpc/testing:benchmark_service_py_pb2_grpc", 70 "//src/proto/grpc/testing:control_py_pb2", 71 "//src/proto/grpc/testing:payloads_py_pb2", 72 "//src/proto/grpc/testing:stats_py_pb2", 73 "//src/proto/grpc/testing:worker_service_py_pb2_grpc", 74 "//src/python/grpcio/grpc:grpcio", 75 "//src/python/grpcio_tests/tests/unit:resources", 76 "//src/python/grpcio_tests/tests/unit:test_common", 77 ], 78) 79 80py_binary( 81 name = "qps_worker", 82 srcs = ["qps_worker.py"], 83 imports = ["../.."], 84 srcs_version = "PY2AND3", 85 deps = [ 86 ":worker_server", 87 "//src/proto/grpc/testing:worker_service_py_pb2_grpc", 88 "//src/python/grpcio/grpc:grpcio", 89 "//src/python/grpcio_tests/tests/unit:test_common", 90 ], 91) 92