diff options
author | Ido Barnea <ibarnea@cisco.com> | 2016-05-30 11:33:22 +0300 |
---|---|---|
committer | Ido Barnea <ibarnea@cisco.com> | 2016-05-30 11:33:22 +0300 |
commit | e73f799983788c328fa5901b9171acfc66de6d5c (patch) | |
tree | ede88f92416c576ba305ba17b5eda9bc4007eb4a /src/bp_gtest.cpp | |
parent | d944dab51f8bcdc3d551acdb1c2c5a4bfa91049b (diff) |
Fixes to latency histogram: Make it multi thread + correct average calculation
Diffstat (limited to 'src/bp_gtest.cpp')
-rwxr-xr-x | src/bp_gtest.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bp_gtest.cpp b/src/bp_gtest.cpp index 6085de76..7bb3da0c 100755 --- a/src/bp_gtest.cpp +++ b/src/bp_gtest.cpp @@ -2657,7 +2657,8 @@ public: TEST_F(time_histogram, test_average) { int i; int j; - for (j=0; j<10; j++) { + // Latency is calculated by low pass filter, so need to give it time to stabilize + for (j=0; j < 13; j++) { for (i=0; i<100; i++) { m_hist.Add(10e-6); } @@ -2667,8 +2668,8 @@ TEST_F(time_histogram, test_average) { m_hist.update(); } - EXPECT_GT(m_hist.get_average_latency(),7400.0); - EXPECT_LT(m_hist.get_average_latency(),7600.0); + EXPECT_GT(m_hist.get_average_latency(), 5004); + EXPECT_LT(m_hist.get_average_latency(), 5005); m_hist.Dump(stdout); } |