BUILD.bazel 3.2 KB

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