Home | History | Annotate | Download | only in qps
      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_test", "grpc_cc_library", "grpc_cc_binary", "grpc_package")
     18 load("//test/cpp/qps:qps_benchmark_script.bzl", "qps_json_driver_batch", "json_run_localhost_batch")
     19 
     20 grpc_package(name = "test/cpp/qps")
     21 
     22 grpc_cc_library(
     23     name = "parse_json",
     24     srcs = ["parse_json.cc"],
     25     hdrs = ["parse_json.h"],
     26     external_deps = ["protobuf"],
     27     deps = ["//:grpc++"],
     28 )
     29 
     30 grpc_cc_library(
     31     name = "qps_worker_impl",
     32     srcs = [
     33         "client_async.cc",
     34         "client_sync.cc",
     35         "qps_server_builder.cc",
     36         "qps_worker.cc",
     37         "server_async.cc",
     38         "server_sync.cc",
     39     ],
     40     hdrs = [
     41         "client.h",
     42         "qps_server_builder.h",
     43         "qps_worker.h",
     44         "server.h",
     45     ],
     46     external_deps = [
     47         "gflags",
     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:gpr_test_util",
     62         "//test/core/util:grpc_test_util",
     63         "//test/cpp/util:test_config",
     64         "//test/cpp/util:test_util",
     65     ],
     66 )
     67 
     68 grpc_cc_library(
     69     name = "driver_impl",
     70     srcs = [
     71         "driver.cc",
     72         "report.cc",
     73     ],
     74     hdrs = [
     75         "driver.h",
     76         "report.h",
     77     ],
     78     deps = [
     79         ":histogram",
     80         ":parse_json",
     81         ":qps_worker_impl",
     82         "//:grpc++",
     83         "//src/proto/grpc/testing:control_proto",
     84         "//src/proto/grpc/testing:messages_proto",
     85         "//src/proto/grpc/testing:report_qps_scenario_service_proto",
     86         "//src/proto/grpc/testing:worker_service_proto",
     87         "//test/core/util:gpr_test_util",
     88         "//test/core/util:grpc_test_util",
     89         "//test/cpp/util:test_util",
     90     ],
     91 )
     92 
     93 grpc_cc_library(
     94     name = "benchmark_config",
     95     srcs = [
     96         "benchmark_config.cc",
     97     ],
     98     hdrs = [
     99         "benchmark_config.h",
    100     ],
    101     external_deps = [
    102         "gflags",
    103     ],
    104     deps = [
    105         ":driver_impl",
    106         ":histogram",
    107         "//:grpc++",
    108         "//src/proto/grpc/testing:control_proto",
    109     ],
    110 )
    111 
    112 grpc_cc_library(
    113     name = "histogram",
    114     hdrs = [
    115         "histogram.h",
    116         "stats.h",
    117     ],
    118     deps = ["//test/core/util:grpc_test_util"],
    119 )
    120 
    121 grpc_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 
    136 grpc_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 
    148 grpc_cc_library(
    149     name = "interarrival",
    150     hdrs = ["interarrival.h"],
    151     deps = ["//:grpc++"],
    152 )
    153 
    154 qps_json_driver_batch()
    155 
    156 json_run_localhost_batch()
    157 
    158 grpc_cc_test(
    159     name = "qps_interarrival_test",
    160     srcs = ["qps_interarrival_test.cc"],
    161     deps = [
    162         ":histogram",
    163         ":interarrival",
    164         "//test/cpp/util:test_config",
    165     ],
    166 )
    167 
    168 grpc_cc_test(
    169     name = "qps_openloop_test",
    170     srcs = ["qps_openloop_test.cc"],
    171     data = ["//third_party/toolchains:RBE_USE_MACHINE_TYPE_LARGE"],
    172     deps = [
    173         ":benchmark_config",
    174         ":driver_impl",
    175         ":qps_worker_impl",
    176         "//test/cpp/util:test_config",
    177         "//test/cpp/util:test_util",
    178     ],
    179 )
    180 
    181 grpc_cc_test(
    182     name = "secure_sync_unary_ping_pong_test",
    183     srcs = ["secure_sync_unary_ping_pong_test.cc"],
    184     deps = [
    185         ":benchmark_config",
    186         ":driver_impl",
    187         "//:grpc++",
    188         "//test/cpp/util:test_config",
    189         "//test/cpp/util:test_util",
    190     ],
    191 )
    192 
    193 grpc_cc_library(
    194     name = "usage_timer",
    195     srcs = ["usage_timer.cc"],
    196     hdrs = ["usage_timer.h"],
    197     deps = ["//:gpr"],
    198 )
    199 
    200 grpc_cc_binary(
    201     name = "qps_worker",
    202     srcs = ["worker.cc"],
    203     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     ],
    211 )
    212