diff --git a/core/tests/local_bump_test.cpp b/core/tests/local_bump_test.cpp index 2ba11405..b3ef7b35 100644 --- a/core/tests/local_bump_test.cpp +++ b/core/tests/local_bump_test.cpp @@ -31,10 +31,10 @@ #include using join::ScopedStats; +using join::Monotonic; using join::BumpPlain; using join::LocalMem; using join::Thread; -using join::Rdtsc; /** * @brief test move. @@ -291,13 +291,13 @@ TEST (LocalBump, benchmark) }); } - Rdtsc::Stats aStats ("allocate"); + Monotonic::Stats aStats ("allocate"); for (int i = 0; i < iterations; ++i) { void* p = nullptr; { - ScopedStats guard (aStats); + ScopedStats guard (aStats); p = allocator.allocate (16); } EXPECT_NE (p, nullptr); @@ -314,13 +314,13 @@ TEST (LocalBump, benchmark) LocalMem::BumpAllocator plain; plain.mlock (); - Rdtsc::Stats pStats ("allocate plain"); + Monotonic::Stats pStats ("allocate plain"); for (int i = 0; i < iterations; ++i) { void* p = nullptr; { - ScopedStats guard (pStats); + ScopedStats guard (pStats); p = plain.allocate (16); } EXPECT_NE (p, nullptr); @@ -336,7 +336,6 @@ TEST (LocalBump, benchmark) */ int main (int argc, char** argv) { - Rdtsc::calibrate (); testing::InitGoogleTest (&argc, argv); return RUN_ALL_TESTS (); } diff --git a/core/tests/local_mpmc_test.cpp b/core/tests/local_mpmc_test.cpp index 4170769b..45960544 100644 --- a/core/tests/local_mpmc_test.cpp +++ b/core/tests/local_mpmc_test.cpp @@ -31,7 +31,7 @@ #include using join::ScopedStats; -using join::Rdtsc; +using join::Monotonic; using join::LocalMem; using join::Thread; @@ -291,7 +291,7 @@ TEST (LocalMpmc, pushBenchmark) } } ready.store (true, std::memory_order_release); - Rdtsc::Stats stats ("MPMC push"); + Monotonic::Stats stats ("MPMC push"); for (int i = 0; i < numProducers; ++i) { producers.emplace_back ([&] () { @@ -302,7 +302,7 @@ TEST (LocalMpmc, pushBenchmark) } for (uint64_t j = 0; j < msgPerProducer; ++j) { - ScopedStats guard (stats); + ScopedStats guard (stats); EXPECT_EQ (queue.push (localData), 0) << join::lastError.message (); } }); @@ -373,14 +373,14 @@ TEST (LocalMpmc, popBenchmark) } ready.store (true, std::memory_order_release); std::vector consumers; - Rdtsc::Stats stats ("MPMC pop"); + Monotonic::Stats stats ("MPMC pop"); for (int p = 0; p < numConsumers; ++p) { consumers.emplace_back ([&] () { uint64_t threadData = 0; for (uint64_t i = 0; i < msgPerConsumer; ++i) { - ScopedStats guard (stats); + ScopedStats guard (stats); EXPECT_EQ (queue.pop (threadData), 0) << join::lastError.message (); } }); @@ -483,7 +483,6 @@ TEST (LocalMpmc, mbind) */ int main (int argc, char** argv) { - Rdtsc::calibrate (); testing::InitGoogleTest (&argc, argv); return RUN_ALL_TESTS (); } diff --git a/core/tests/local_mpsc_test.cpp b/core/tests/local_mpsc_test.cpp index f7984947..51a988f8 100644 --- a/core/tests/local_mpsc_test.cpp +++ b/core/tests/local_mpsc_test.cpp @@ -31,7 +31,7 @@ #include using join::ScopedStats; -using join::Rdtsc; +using join::Monotonic; using join::LocalMem; using join::Thread; @@ -293,13 +293,13 @@ TEST (LocalMpsc, pushBenchmark) } } ready.store (true, std::memory_order_release); - Rdtsc::Stats stats ("MPSC push"); + Monotonic::Stats stats ("MPSC push"); for (int p = 0; p < numProducers; ++p) { producers.emplace_back ([&] () { for (uint64_t i = 0; i < msgPerProducer; ++i) { - ScopedStats guard (stats); + ScopedStats guard (stats); EXPECT_EQ (queue.push (data), 0) << join::lastError.message (); } }); @@ -348,10 +348,10 @@ TEST (LocalMpsc, popBenchmark) uint64_t data = 0; ready.store (true, std::memory_order_release); - Rdtsc::Stats stats ("MPSC pop"); + Monotonic::Stats stats ("MPSC pop"); for (uint64_t i = 0; i < num; ++i) { - ScopedStats guard (stats); + ScopedStats guard (stats); EXPECT_EQ (queue.pop (data), 0) << join::lastError.message (); } for (auto& p : producers) @@ -439,7 +439,6 @@ TEST (LocalMpsc, mbind) */ int main (int argc, char** argv) { - Rdtsc::calibrate (); testing::InitGoogleTest (&argc, argv); return RUN_ALL_TESTS (); } diff --git a/core/tests/local_slab_test.cpp b/core/tests/local_slab_test.cpp index cfe43588..a8cce10e 100644 --- a/core/tests/local_slab_test.cpp +++ b/core/tests/local_slab_test.cpp @@ -31,7 +31,7 @@ #include using join::ScopedStats; -using join::Rdtsc; +using join::Monotonic; using join::LocalMem; using join::Thread; @@ -276,20 +276,20 @@ TEST (LocalSlab, benchmark) }); } - Rdtsc::Stats aStats ("allocate"); - Rdtsc::Stats dStats ("deallocate"); + Monotonic::Stats aStats ("allocate"); + Monotonic::Stats dStats ("deallocate"); for (int i = 0; i < iterations; ++i) { void* p = nullptr; { - ScopedStats guard (aStats); + ScopedStats guard (aStats); p = allocator.allocate (64); } EXPECT_NE (p, nullptr); if (p) { - ScopedStats guard (dStats); + ScopedStats guard (dStats); allocator.deallocate (p); } } @@ -309,7 +309,6 @@ TEST (LocalSlab, benchmark) */ int main (int argc, char** argv) { - Rdtsc::calibrate (); testing::InitGoogleTest (&argc, argv); return RUN_ALL_TESTS (); } diff --git a/core/tests/local_spsc_test.cpp b/core/tests/local_spsc_test.cpp index 4044fd39..d0268264 100644 --- a/core/tests/local_spsc_test.cpp +++ b/core/tests/local_spsc_test.cpp @@ -31,7 +31,7 @@ #include using join::ScopedStats; -using join::Rdtsc; +using join::Monotonic; using join::LocalMem; using join::Thread; @@ -348,11 +348,11 @@ TEST (LocalSpsc, pushBenchmark) } ready.store (true, std::memory_order_release); - Rdtsc::Stats stats ("SPSC push"); + Monotonic::Stats stats ("SPSC push"); for (uint64_t i = 0; i < num; ++i) { - ScopedStats guard (stats); + ScopedStats guard (stats); EXPECT_EQ (queue.push (data), 0) << join::lastError.message (); } @@ -392,11 +392,11 @@ TEST (LocalSpsc, popBenchmark) } uint64_t data = 0; - Rdtsc::Stats stats ("SPSC pop"); + Monotonic::Stats stats ("SPSC pop"); for (uint64_t i = 0; i < num; ++i) { - ScopedStats guard (stats); + ScopedStats guard (stats); EXPECT_EQ (queue.pop (data), 0) << join::lastError.message (); } @@ -482,7 +482,6 @@ TEST (LocalSpsc, mbind) */ int main (int argc, char** argv) { - Rdtsc::calibrate (); testing::InitGoogleTest (&argc, argv); return RUN_ALL_TESTS (); } diff --git a/core/tests/shm_mpmc_test.cpp b/core/tests/shm_mpmc_test.cpp index 88c54848..38e01270 100644 --- a/core/tests/shm_mpmc_test.cpp +++ b/core/tests/shm_mpmc_test.cpp @@ -32,7 +32,7 @@ #include using join::ScopedStats; -using join::Rdtsc; +using join::Monotonic; using join::Semaphore; using join::ShmMem; using join::Thread; @@ -358,14 +358,14 @@ TEST_F (ShmMpmc, pushBenchmark) } } sem.post (); - Rdtsc::Stats stats ("MPMC push"); + Monotonic::Stats stats ("MPMC push"); for (int p = 0; p < numProducers; ++p) { producers.emplace_back ([&] () { ShmMem::Mpmc::Queue prod (capacity, _name); for (uint64_t i = 0; i < msgPerProducer; ++i) { - ScopedStats guard (stats); + ScopedStats guard (stats); EXPECT_EQ (prod.push (data), 0) << join::lastError.message (); } }); @@ -437,7 +437,7 @@ TEST_F (ShmMpmc, popBenchmark) const uint64_t msgPerConsumer = num / numConsumers; Semaphore sem (_name); sem.wait (); - Rdtsc::Stats stats ("MPMC pop"); + Monotonic::Stats stats ("MPMC pop"); for (int p = 0; p < numConsumers; ++p) { consumers.emplace_back ([&] () { @@ -445,7 +445,7 @@ TEST_F (ShmMpmc, popBenchmark) uint64_t data = 0; for (uint64_t i = 0; i < msgPerConsumer; ++i) { - ScopedStats guard (stats); + ScopedStats guard (stats); EXPECT_EQ (cons.pop (data), 0) << join::lastError.message (); } }); @@ -550,7 +550,6 @@ TEST_F (ShmMpmc, mbind) */ int main (int argc, char** argv) { - Rdtsc::calibrate (); testing::InitGoogleTest (&argc, argv); return RUN_ALL_TESTS (); } diff --git a/core/tests/shm_mpsc_test.cpp b/core/tests/shm_mpsc_test.cpp index ac3f3f0a..fd3ef176 100644 --- a/core/tests/shm_mpsc_test.cpp +++ b/core/tests/shm_mpsc_test.cpp @@ -32,7 +32,7 @@ #include using join::ScopedStats; -using join::Rdtsc; +using join::Monotonic; using join::Semaphore; using join::ShmMem; using join::Thread; @@ -344,14 +344,14 @@ TEST_F (ShmMpsc, pushBenchmark) } } sem.post (); - Rdtsc::Stats stats ("MPSC push"); + Monotonic::Stats stats ("MPSC push"); for (int p = 0; p < numProducers; ++p) { producers.emplace_back ([&] () { ShmMem::Mpsc::Queue prod (capacity, _name); for (uint64_t i = 0; i < msgPerProducer; ++i) { - ScopedStats guard (stats); + ScopedStats guard (stats); EXPECT_EQ (prod.push (data), 0) << join::lastError.message (); } }); @@ -413,10 +413,10 @@ TEST_F (ShmMpsc, popBenchmark) Semaphore sem (_name); sem.wait (); ShmMem::Mpsc::Queue cons (capacity, _name); - Rdtsc::Stats stats ("MPSC pop"); + Monotonic::Stats stats ("MPSC pop"); for (uint64_t i = 0; i < num; ++i) { - ScopedStats guard (stats); + ScopedStats guard (stats); EXPECT_EQ (cons.pop (data), 0) << join::lastError.message (); } std::cout << join::statsHeader << "\n"; @@ -506,7 +506,6 @@ TEST_F (ShmMpsc, mbind) */ int main (int argc, char** argv) { - Rdtsc::calibrate (); testing::InitGoogleTest (&argc, argv); return RUN_ALL_TESTS (); } diff --git a/core/tests/shm_slab_test.cpp b/core/tests/shm_slab_test.cpp index b23eb9ef..565dc47c 100644 --- a/core/tests/shm_slab_test.cpp +++ b/core/tests/shm_slab_test.cpp @@ -30,7 +30,7 @@ #include using join::ScopedStats; -using join::Rdtsc; +using join::Monotonic; using join::ShmMem; /** @@ -303,20 +303,20 @@ TEST_F (ShmSlab, benchmark) pids.push_back (pid); } - Rdtsc::Stats aStats ("allocate"); - Rdtsc::Stats dStats ("deallocate"); + Monotonic::Stats aStats ("allocate"); + Monotonic::Stats dStats ("deallocate"); for (int i = 0; i < iterations; ++i) { void* p = nullptr; { - ScopedStats guard (aStats); + ScopedStats guard (aStats); p = allocator.allocate (64); } EXPECT_NE (p, nullptr); if (p) { - ScopedStats guard (dStats); + ScopedStats guard (dStats); allocator.deallocate (p); } } @@ -338,7 +338,6 @@ TEST_F (ShmSlab, benchmark) */ int main (int argc, char** argv) { - Rdtsc::calibrate (); testing::InitGoogleTest (&argc, argv); return RUN_ALL_TESTS (); } diff --git a/core/tests/shm_spsc_test.cpp b/core/tests/shm_spsc_test.cpp index e5f478f1..33b16785 100644 --- a/core/tests/shm_spsc_test.cpp +++ b/core/tests/shm_spsc_test.cpp @@ -32,7 +32,7 @@ #include using join::ScopedStats; -using join::Rdtsc; +using join::Monotonic; using join::Semaphore; using join::Backoff; using join::ShmMem; @@ -398,10 +398,10 @@ TEST_F (ShmSpsc, pushBenchmark) } } sem.post (); - Rdtsc::Stats stats ("SPSC push"); + Monotonic::Stats stats ("SPSC push"); for (uint64_t i = 0; i < num; ++i) { - ScopedStats guard (stats); + ScopedStats guard (stats); EXPECT_EQ (prod.push (data), 0) << join::lastError.message (); } std::cout << join::statsHeader << "\n"; @@ -444,10 +444,10 @@ TEST_F (ShmSpsc, popBenchmark) Semaphore sem (_name); sem.wait (); ShmMem::Spsc::Queue cons (capacity, _name); - Rdtsc::Stats stats ("SPSC pop"); + Monotonic::Stats stats ("SPSC pop"); for (uint64_t i = 0; i < num; ++i) { - ScopedStats guard (stats); + ScopedStats guard (stats); EXPECT_EQ (cons.pop (data), 0) << join::lastError.message (); } std::cout << join::statsHeader << "\n"; @@ -537,7 +537,6 @@ TEST_F (ShmSpsc, mbind) */ int main (int argc, char** argv) { - Rdtsc::calibrate (); testing::InitGoogleTest (&argc, argv); return RUN_ALL_TESTS (); }