Abseil Team | 4bb9e39 | 2021-09-01 13:48:23 -0700 | [diff] [blame] | 1 | # Copyright 2021 The Abseil 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 | # https://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 | |
Abseil Team | b2dc72c | 2021-09-13 17:04:32 -0700 | [diff] [blame] | 15 | load( |
| 16 | "//absl:copts/configure_copts.bzl", |
| 17 | "ABSL_DEFAULT_COPTS", |
| 18 | "ABSL_DEFAULT_LINKOPTS", |
Abseil Team | a59b4da | 2021-10-06 17:55:30 -0700 | [diff] [blame] | 19 | "ABSL_TEST_COPTS", |
Abseil Team | b2dc72c | 2021-09-13 17:04:32 -0700 | [diff] [blame] | 20 | ) |
| 21 | |
Derek Mauro | 143e983 | 2023-10-10 13:29:16 -0700 | [diff] [blame] | 22 | package( |
| 23 | default_visibility = ["//visibility:private"], |
| 24 | features = [ |
Derek Mauro | 0ef3ef4 | 2023-10-11 07:57:33 -0700 | [diff] [blame] | 25 | "header_modules", |
Derek Mauro | 143e983 | 2023-10-10 13:29:16 -0700 | [diff] [blame] | 26 | "layering_check", |
| 27 | "parse_headers", |
| 28 | ], |
| 29 | ) |
Abseil Team | 4bb9e39 | 2021-09-01 13:48:23 -0700 | [diff] [blame] | 30 | |
| 31 | licenses(["notice"]) |
Abseil Team | b2dc72c | 2021-09-13 17:04:32 -0700 | [diff] [blame] | 32 | |
| 33 | cc_library( |
| 34 | name = "sample_recorder", |
| 35 | hdrs = ["internal/sample_recorder.h"], |
| 36 | copts = ABSL_DEFAULT_COPTS, |
| 37 | linkopts = ABSL_DEFAULT_LINKOPTS, |
Abseil Team | 29f8307 | 2021-09-20 13:35:36 -0700 | [diff] [blame] | 38 | visibility = [ |
| 39 | "//absl:__subpackages__", |
| 40 | ], |
Abseil Team | b2dc72c | 2021-09-13 17:04:32 -0700 | [diff] [blame] | 41 | deps = [ |
| 42 | "//absl/base:config", |
| 43 | "//absl/base:core_headers", |
| 44 | "//absl/synchronization", |
| 45 | "//absl/time", |
| 46 | ], |
| 47 | ) |
| 48 | |
| 49 | cc_test( |
| 50 | name = "sample_recorder_test", |
| 51 | srcs = ["internal/sample_recorder_test.cc"], |
| 52 | linkopts = ABSL_DEFAULT_LINKOPTS, |
Tom Rybka | c34c552 | 2022-06-02 08:22:18 -0700 | [diff] [blame] | 53 | tags = [ |
| 54 | "no_test_wasm", |
| 55 | ], |
Abseil Team | b2dc72c | 2021-09-13 17:04:32 -0700 | [diff] [blame] | 56 | deps = [ |
| 57 | ":sample_recorder", |
| 58 | "//absl/base:core_headers", |
| 59 | "//absl/synchronization", |
| 60 | "//absl/synchronization:thread_pool", |
| 61 | "//absl/time", |
Derek Mauro | 143e983 | 2023-10-10 13:29:16 -0700 | [diff] [blame] | 62 | "@com_google_googletest//:gtest", |
Abseil Team | b2dc72c | 2021-09-13 17:04:32 -0700 | [diff] [blame] | 63 | "@com_google_googletest//:gtest_main", |
| 64 | ], |
| 65 | ) |
Abseil Team | a59b4da | 2021-10-06 17:55:30 -0700 | [diff] [blame] | 66 | |
| 67 | cc_library( |
| 68 | name = "exponential_biased", |
| 69 | srcs = ["internal/exponential_biased.cc"], |
| 70 | hdrs = ["internal/exponential_biased.h"], |
| 71 | linkopts = ABSL_DEFAULT_LINKOPTS, |
| 72 | visibility = [ |
| 73 | "//absl:__subpackages__", |
| 74 | ], |
| 75 | deps = [ |
| 76 | "//absl/base:config", |
| 77 | "//absl/base:core_headers", |
| 78 | ], |
| 79 | ) |
| 80 | |
| 81 | cc_test( |
| 82 | name = "exponential_biased_test", |
| 83 | size = "small", |
| 84 | srcs = ["internal/exponential_biased_test.cc"], |
| 85 | copts = ABSL_TEST_COPTS, |
| 86 | linkopts = ABSL_DEFAULT_LINKOPTS, |
| 87 | visibility = ["//visibility:private"], |
| 88 | deps = [ |
| 89 | ":exponential_biased", |
| 90 | "//absl/strings", |
Derek Mauro | 143e983 | 2023-10-10 13:29:16 -0700 | [diff] [blame] | 91 | "@com_google_googletest//:gtest", |
Abseil Team | a59b4da | 2021-10-06 17:55:30 -0700 | [diff] [blame] | 92 | "@com_google_googletest//:gtest_main", |
| 93 | ], |
| 94 | ) |
| 95 | |
| 96 | cc_library( |
| 97 | name = "periodic_sampler", |
| 98 | srcs = ["internal/periodic_sampler.cc"], |
| 99 | hdrs = ["internal/periodic_sampler.h"], |
| 100 | copts = ABSL_DEFAULT_COPTS, |
| 101 | linkopts = ABSL_DEFAULT_LINKOPTS, |
| 102 | visibility = [ |
Abseil Team | 8bb4174 | 2023-10-11 10:20:04 -0700 | [diff] [blame] | 103 | # TODO(b/304670045): remove after periodic_sampler moves to //spanner/common. |
Abseil Team | a59b4da | 2021-10-06 17:55:30 -0700 | [diff] [blame] | 104 | "//absl:__subpackages__", |
| 105 | ], |
| 106 | deps = [ |
| 107 | ":exponential_biased", |
| 108 | "//absl/base:core_headers", |
| 109 | ], |
| 110 | ) |
| 111 | |
| 112 | cc_test( |
| 113 | name = "periodic_sampler_test", |
| 114 | size = "small", |
| 115 | srcs = ["internal/periodic_sampler_test.cc"], |
| 116 | copts = ABSL_TEST_COPTS, |
| 117 | linkopts = ABSL_DEFAULT_LINKOPTS, |
| 118 | visibility = ["//visibility:private"], |
| 119 | deps = [ |
| 120 | ":periodic_sampler", |
| 121 | "//absl/base:core_headers", |
Derek Mauro | 143e983 | 2023-10-10 13:29:16 -0700 | [diff] [blame] | 122 | "@com_google_googletest//:gtest", |
Abseil Team | a59b4da | 2021-10-06 17:55:30 -0700 | [diff] [blame] | 123 | "@com_google_googletest//:gtest_main", |
| 124 | ], |
| 125 | ) |
| 126 | |
| 127 | cc_binary( |
| 128 | name = "periodic_sampler_benchmark", |
Shahriar Rouf | 780bfc1 | 2024-01-31 10:07:48 -0800 | [diff] [blame] | 129 | testonly = True, |
Abseil Team | a59b4da | 2021-10-06 17:55:30 -0700 | [diff] [blame] | 130 | srcs = ["internal/periodic_sampler_benchmark.cc"], |
| 131 | copts = ABSL_TEST_COPTS, |
| 132 | linkopts = ABSL_DEFAULT_LINKOPTS, |
| 133 | tags = ["benchmark"], |
| 134 | visibility = ["//visibility:private"], |
| 135 | deps = [ |
| 136 | ":periodic_sampler", |
| 137 | "//absl/base:core_headers", |
| 138 | "@com_github_google_benchmark//:benchmark_main", |
| 139 | ], |
| 140 | ) |