#include "base/rand_util.h"
#include <limits.h>
#include <math.h>
#include <stdint.h>
#include <algorithm>
#include <atomic>
#include <limits>
#include "base/check_op.h"
#include "base/time/time.h"
namespace base {
namespace {
std::atomic<bool> g_subsampling_always_sample = …;
std::atomic<bool> g_subsampling_never_sample = …;
}
uint64_t RandUint64() { … }
int RandInt(int min, int max) { … }
double RandDouble() { … }
float RandFloat() { … }
TimeDelta RandTimeDelta(TimeDelta start, TimeDelta limit) { … }
TimeDelta RandTimeDeltaUpTo(TimeDelta limit) { … }
double BitsToOpenEndedUnitInterval(uint64_t bits) { … }
float BitsToOpenEndedUnitIntervalF(uint64_t bits) { … }
uint64_t RandGenerator(uint64_t range) { … }
std::string RandBytesAsString(size_t length) { … }
std::vector<uint8_t> RandBytesAsVector(size_t length) { … }
InsecureRandomGenerator::InsecureRandomGenerator() { … }
void InsecureRandomGenerator::ReseedForTesting(uint64_t seed) { … }
uint64_t InsecureRandomGenerator::RandUint64() { … }
uint32_t InsecureRandomGenerator::RandUint32() { … }
double InsecureRandomGenerator::RandDouble() { … }
MetricsSubSampler::MetricsSubSampler() = default;
bool MetricsSubSampler::ShouldSample(double probability) { … }
MetricsSubSampler::ScopedAlwaysSampleForTesting::
ScopedAlwaysSampleForTesting() { … }
MetricsSubSampler::ScopedAlwaysSampleForTesting::
~ScopedAlwaysSampleForTesting() { … }
MetricsSubSampler::ScopedNeverSampleForTesting::ScopedNeverSampleForTesting() { … }
MetricsSubSampler::ScopedNeverSampleForTesting::~ScopedNeverSampleForTesting() { … }
}