MCPcopy Create free account
hub / github.com/Tencent/phxqueue / Rebuild

Method Rebuild

phxqueue/comm/utils/time_util.cpp:81–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81void PoissonDistribution :: Rebuild(const int base_interval_time_ms) {
82 double times_per_ms = (double)1.0 / (double)base_interval_time_ms;
83 impl_->delay_distribution.reset(new std::exponential_distribution<double>(times_per_ms));
84 assert(impl_->delay_distribution != nullptr);
85
86 int seed = std::chrono::system_clock::now().time_since_epoch().count();
87 impl_->delay_generator.reset(new std::default_random_engine(seed));
88 assert(impl_->delay_generator != nullptr);
89}
90
91const int PoissonDistribution :: GetNextIntervalTimeMs() {
92

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected