| 46 | latency_dist_(average_latency, average_latency * kStandardDeviationRatio) {} |
| 47 | |
| 48 | double NextLatency() override { |
| 49 | // std::random distributions are unlikely to be thread-safe, and |
| 50 | // a RandomAccessFile may be called from multiple threads |
| 51 | std::lock_guard<std::mutex> lock(mutex_); |
| 52 | return std::max<double>(0.0, latency_dist_(gen_)); |
| 53 | } |
| 54 | |
| 55 | private: |
| 56 | std::default_random_engine gen_; |
nothing calls this directly
no outgoing calls
no test coverage detected