BUILD 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # Copyright 2019 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. package(default_visibility = ["//visibility:public"])
  15. load("@grpc_python_dependencies//:requirements.bzl", "requirement")
  16. py_library(
  17. name = "benchmark_client",
  18. srcs = ["benchmark_client.py"],
  19. imports = ["../../"],
  20. deps = [
  21. requirement("six"),
  22. "//src/proto/grpc/testing:py_benchmark_service_proto",
  23. "//src/proto/grpc/testing:py_messages_proto",
  24. "//src/python/grpcio/grpc:grpcio",
  25. "//src/python/grpcio_tests/tests/unit:resources",
  26. "//src/python/grpcio_tests/tests/unit:test_common",
  27. ],
  28. )
  29. py_library(
  30. name = "benchmark_server",
  31. srcs = ["benchmark_server.py"],
  32. imports = ["../../"],
  33. deps = [
  34. "//src/proto/grpc/testing:py_benchmark_service_proto",
  35. "//src/proto/grpc/testing:py_messages_proto",
  36. ],
  37. )
  38. py_library(
  39. name = "client_runner",
  40. srcs = ["client_runner.py"],
  41. imports = ["../../"],
  42. )
  43. py_library(
  44. name = "histogram",
  45. srcs = ["histogram.py"],
  46. imports = ["../../"],
  47. deps = [
  48. "//src/proto/grpc/testing:py_stats_proto",
  49. ],
  50. )
  51. py_library(
  52. name = "worker_server",
  53. srcs = ["worker_server.py"],
  54. imports = ["../../"],
  55. deps = [
  56. ":benchmark_client",
  57. ":benchmark_server",
  58. ":client_runner",
  59. ":histogram",
  60. "//src/proto/grpc/testing:py_benchmark_service_proto",
  61. "//src/proto/grpc/testing:py_control_proto",
  62. "//src/proto/grpc/testing:py_stats_proto",
  63. "//src/proto/grpc/testing:py_worker_service_proto",
  64. "//src/python/grpcio/grpc:grpcio",
  65. "//src/python/grpcio_tests/tests/unit:resources",
  66. "//src/python/grpcio_tests/tests/unit:test_common",
  67. ],
  68. )
  69. py_binary(
  70. name = "qps_worker",
  71. srcs = ["qps_worker.py"],
  72. imports = ["../../"],
  73. main = "qps_worker.py",
  74. deps = [
  75. ":worker_server",
  76. "//src/proto/grpc/testing:py_worker_service_proto",
  77. "//src/python/grpcio/grpc:grpcio",
  78. "//src/python/grpcio_tests/tests/unit:test_common",
  79. ],
  80. )
  81. filegroup(
  82. name = "scenarios",
  83. srcs = ["scenarios.json"],
  84. )
  85. sh_test(
  86. name = "basic_benchmark_test",
  87. srcs = ["basic_benchmark_test.sh"],
  88. data = [
  89. ":qps_worker",
  90. ":scenarios",
  91. "//test/cpp/qps:qps_json_driver",
  92. ],
  93. )