diff options
Diffstat (limited to 'test/cpp/qps')
-rw-r--r-- | test/cpp/qps/client.h | 14 | ||||
-rw-r--r-- | test/cpp/qps/interarrival.h | 56 | ||||
-rw-r--r-- | test/cpp/qps/qps_driver.cc | 16 | ||||
-rw-r--r-- | test/cpp/qps/qps_interarrival_test.cc | 6 |
4 files changed, 0 insertions, 92 deletions
diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h index e958141d4e..5a9027a4a2 100644 --- a/test/cpp/qps/client.h +++ b/test/cpp/qps/client.h @@ -173,20 +173,6 @@ class Client { random_dist.reset( new ExpDist(load.poisson().offered_load() / num_threads)); break; - case LoadParams::kUniform: - random_dist.reset( - new UniformDist(load.uniform().interarrival_lo() * num_threads, - load.uniform().interarrival_hi() * num_threads)); - break; - case LoadParams::kDeterm: - random_dist.reset( - new DetDist(num_threads / load.determ().offered_load())); - break; - case LoadParams::kPareto: - random_dist.reset( - new ParetoDist(load.pareto().interarrival_base() * num_threads, - load.pareto().alpha())); - break; default: GPR_ASSERT(false); } 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 diff --git a/test/cpp/qps/qps_driver.cc b/test/cpp/qps/qps_driver.cc index 608181f77f..e4683e475f 100644 --- a/test/cpp/qps/qps_driver.cc +++ b/test/cpp/qps/qps_driver.cc @@ -68,11 +68,6 @@ DEFINE_string(client_type, "SYNC_CLIENT", "Client type"); DEFINE_int32(async_client_threads, 1, "Async client threads"); DEFINE_double(poisson_load, -1.0, "Poisson offered load (qps)"); -DEFINE_double(uniform_lo, -1.0, "Uniform low interarrival time (us)"); -DEFINE_double(uniform_hi, -1.0, "Uniform high interarrival time (us)"); -DEFINE_double(determ_load, -1.0, "Deterministic offered load (qps)"); -DEFINE_double(pareto_base, -1.0, "Pareto base interarrival time (us)"); -DEFINE_double(pareto_alpha, -1.0, "Pareto alpha value"); DEFINE_int32(client_core_limit, -1, "Limit on client cores to use"); @@ -137,17 +132,6 @@ static void QpsDriver() { if (FLAGS_poisson_load > 0.0) { auto poisson = client_config.mutable_load_params()->mutable_poisson(); poisson->set_offered_load(FLAGS_poisson_load); - } else if (FLAGS_uniform_lo > 0.0) { - auto uniform = client_config.mutable_load_params()->mutable_uniform(); - uniform->set_interarrival_lo(FLAGS_uniform_lo / 1e6); - uniform->set_interarrival_hi(FLAGS_uniform_hi / 1e6); - } else if (FLAGS_determ_load > 0.0) { - auto determ = client_config.mutable_load_params()->mutable_determ(); - determ->set_offered_load(FLAGS_determ_load); - } else if (FLAGS_pareto_base > 0.0) { - auto pareto = client_config.mutable_load_params()->mutable_pareto(); - pareto->set_interarrival_base(FLAGS_pareto_base / 1e6); - pareto->set_alpha(FLAGS_pareto_alpha); } else { client_config.mutable_load_params()->mutable_closed_loop(); // No further load parameters to set up for closed loop diff --git a/test/cpp/qps/qps_interarrival_test.cc b/test/cpp/qps/qps_interarrival_test.cc index 48585af756..4055c8a718 100644 --- a/test/cpp/qps/qps_interarrival_test.cc +++ b/test/cpp/qps/qps_interarrival_test.cc @@ -63,14 +63,8 @@ static void RunTest(RandomDistInterface &&r, int threads, std::string title) { } using grpc::testing::ExpDist; -using grpc::testing::DetDist; -using grpc::testing::UniformDist; -using grpc::testing::ParetoDist; int main(int argc, char **argv) { RunTest(ExpDist(10.0), 5, std::string("Exponential(10)")); - RunTest(DetDist(5.0), 5, std::string("Det(5)")); - RunTest(UniformDist(0.0, 10.0), 5, std::string("Uniform(0,10)")); - RunTest(ParetoDist(1.0, 1.0), 5, std::string("Pareto(1,1)")); return 0; } |