diff options
Diffstat (limited to 'test/cpp/qps/interarrival.h')
-rw-r--r-- | test/cpp/qps/interarrival.h | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/test/cpp/qps/interarrival.h b/test/cpp/qps/interarrival.h index 0cc78533ce..0980d5e8ba 100644 --- a/test/cpp/qps/interarrival.h +++ b/test/cpp/qps/interarrival.h @@ -82,62 +82,6 @@ class ExpDist GRPC_FINAL : public RandomDistInterface { double lambda_recip_; }; -// UniformDist implements a random distribution that has -// interarrival time uniformly spread between [lo,hi). The -// mean interarrival time is (lo+hi)/2. For more information, -// see http://en.wikipedia.org/wiki/Uniform_distribution_%28continuous%29 - -class UniformDist GRPC_FINAL : public RandomDistInterface { - public: - UniformDist(double lo, double hi) : lo_(lo), range_(hi - lo) {} - ~UniformDist() GRPC_OVERRIDE {} - double transform(double uni) const GRPC_OVERRIDE { - return uni * range_ + lo_; - } - - private: - double lo_; - double range_; -}; - -// DetDist provides a random distribution with interarrival time -// of val. Note that this is not additive, so using this on multiple -// flows of control (threads within the same client or separate -// clients) will not preserve any deterministic interarrival gap across -// requests. - -class DetDist GRPC_FINAL : public RandomDistInterface { - public: - explicit DetDist(double val) : val_(val) {} - ~DetDist() GRPC_OVERRIDE {} - double transform(double uni) const GRPC_OVERRIDE { return val_; } - - private: - double val_; -}; - -// ParetoDist provides a random distribution with interarrival time -// spread according to a Pareto (heavy-tailed) distribution. In this -// model, many interarrival times are close to the base, but a sufficient -// number will be high (up to infinity) as to disturb the mean. It is a -// good representation of the response times of data center jobs. See -// http://en.wikipedia.org/wiki/Pareto_distribution - -class ParetoDist GRPC_FINAL : public RandomDistInterface { - public: - ParetoDist(double base, double alpha) - : base_(base), alpha_recip_(1.0 / alpha) {} - ~ParetoDist() GRPC_OVERRIDE {} - double transform(double uni) const GRPC_OVERRIDE { - // Note: Use 1.0-uni above to avoid div by zero if uni is 0 - return base_ / pow(1.0 - uni, alpha_recip_); - } - - private: - double base_; - double alpha_recip_; -}; - // A class library for generating pseudo-random interarrival times // in an efficient re-entrant way. The random table is built at construction // time, and each call must include the thread id of the invoker |