Module: RedisQueuedLocks::Logging::Sampler
- Defined in:
- lib/redis_queued_locks/logging/sampler.rb
Overview
Constant Summary collapse
- SAMPLING_PERCENT_RANGE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
(0..100)
Class Method Summary collapse
-
.sampling_happened?(sampling_percent) ⇒ Boolean
Super simple probalistic function based on the
weightof/ values.
Class Method Details
.sampling_happened?(sampling_percent) ⇒ Boolean
Super simple probalistic function based on the weight of
24 25 26 |
# File 'lib/redis_queued_locks/logging/sampler.rb', line 24 def sampling_happened?(sampling_percent) sampling_percent >= SecureRandom.rand(SAMPLING_PERCENT_RANGE) end |