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 15load( 16 "//absl:copts/configure_copts.bzl", 17 "ABSL_DEFAULT_COPTS", 18 "ABSL_DEFAULT_LINKOPTS", 19 "ABSL_TEST_COPTS", 20) 21 22package(default_visibility = ["//visibility:private"]) 23 24licenses(["notice"]) 25 26cc_library( 27 name = "sample_recorder", 28 hdrs = ["internal/sample_recorder.h"], 29 copts = ABSL_DEFAULT_COPTS, 30 linkopts = ABSL_DEFAULT_LINKOPTS, 31 visibility = [ 32 "//absl:__subpackages__", 33 ], 34 deps = [ 35 "//absl/base:config", 36 "//absl/base:core_headers", 37 "//absl/synchronization", 38 "//absl/time", 39 ], 40) 41 42cc_test( 43 name = "sample_recorder_test", 44 srcs = ["internal/sample_recorder_test.cc"], 45 linkopts = ABSL_DEFAULT_LINKOPTS, 46 tags = [ 47 "no_test_wasm", 48 ], 49 deps = [ 50 ":sample_recorder", 51 "//absl/base:core_headers", 52 "//absl/synchronization", 53 "//absl/synchronization:thread_pool", 54 "//absl/time", 55 "@com_google_googletest//:gtest_main", 56 ], 57) 58 59cc_library( 60 name = "exponential_biased", 61 srcs = ["internal/exponential_biased.cc"], 62 hdrs = ["internal/exponential_biased.h"], 63 linkopts = ABSL_DEFAULT_LINKOPTS, 64 visibility = [ 65 "//absl:__subpackages__", 66 ], 67 deps = [ 68 "//absl/base:config", 69 "//absl/base:core_headers", 70 ], 71) 72 73cc_test( 74 name = "exponential_biased_test", 75 size = "small", 76 srcs = ["internal/exponential_biased_test.cc"], 77 copts = ABSL_TEST_COPTS, 78 linkopts = ABSL_DEFAULT_LINKOPTS, 79 visibility = ["//visibility:private"], 80 deps = [ 81 ":exponential_biased", 82 "//absl/strings", 83 "@com_google_googletest//:gtest_main", 84 ], 85) 86 87cc_library( 88 name = "periodic_sampler", 89 srcs = ["internal/periodic_sampler.cc"], 90 hdrs = ["internal/periodic_sampler.h"], 91 copts = ABSL_DEFAULT_COPTS, 92 linkopts = ABSL_DEFAULT_LINKOPTS, 93 visibility = [ 94 "//absl:__subpackages__", 95 ], 96 deps = [ 97 ":exponential_biased", 98 "//absl/base:core_headers", 99 ], 100) 101 102cc_test( 103 name = "periodic_sampler_test", 104 size = "small", 105 srcs = ["internal/periodic_sampler_test.cc"], 106 copts = ABSL_TEST_COPTS, 107 linkopts = ABSL_DEFAULT_LINKOPTS, 108 visibility = ["//visibility:private"], 109 deps = [ 110 ":periodic_sampler", 111 "//absl/base:core_headers", 112 "@com_google_googletest//:gtest_main", 113 ], 114) 115 116cc_binary( 117 name = "periodic_sampler_benchmark", 118 testonly = 1, 119 srcs = ["internal/periodic_sampler_benchmark.cc"], 120 copts = ABSL_TEST_COPTS, 121 linkopts = ABSL_DEFAULT_LINKOPTS, 122 tags = ["benchmark"], 123 visibility = ["//visibility:private"], 124 deps = [ 125 ":periodic_sampler", 126 "//absl/base:core_headers", 127 "@com_github_google_benchmark//:benchmark_main", 128 ], 129) 130