aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps/interarrival.h
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2016-02-11 06:05:24 -0800
committerGravatar Vijay Pai <vpai@google.com>2016-02-11 06:05:24 -0800
commit1132c6b7db990d83fd178c927c39d0b67fa02778 (patch)
tree97a71efd97084efbc8c8935624f3704a1bf9b8e3 /test/cpp/qps/interarrival.h
parentd472ad2a7fe19474409a5dff1afab5244072fda4 (diff)
Simplify and properly implement openloop testing.
Revive it in tests as well
Diffstat (limited to 'test/cpp/qps/interarrival.h')
-rw-r--r--test/cpp/qps/interarrival.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/cpp/qps/interarrival.h b/test/cpp/qps/interarrival.h
index d1bfdcd756..33f102fe97 100644
--- a/test/cpp/qps/interarrival.h
+++ b/test/cpp/qps/interarrival.h
@@ -151,9 +151,8 @@ class InterarrivalTimer {
// and that supports new and old compilers
const double uniform_0_1 = static_cast<double>(rand())
/ static_cast<double>(RAND_MAX);
- random_table_.push_back(
- std::chrono::nanoseconds(static_cast<int64_t>(
- 1e9 * r.transform(uniform_0_1))));
+ random_table_.push_back(static_cast<int64_t>(
+ 1e9 * r.transform(uniform_0_1)));
}
// Now set up the thread positions
for (int i = 0; i < threads; i++) {
@@ -162,7 +161,7 @@ class InterarrivalTimer {
}
virtual ~InterarrivalTimer(){};
- std::chrono::nanoseconds next(int thread_num) {
+ int64_t next(int thread_num) {
auto ret = *(thread_posns_[thread_num]++);
if (thread_posns_[thread_num] == random_table_.end())
thread_posns_[thread_num] = random_table_.begin();
@@ -170,7 +169,7 @@ class InterarrivalTimer {
}
private:
- typedef std::vector<std::chrono::nanoseconds> time_table;
+ typedef std::vector<int64_t> time_table;
std::vector<time_table::const_iterator> thread_posns_;
time_table random_table_;
};