Skip to content

Commit fbb38c3

Browse files
authoredApr 14, 2020
Verify in CI that simple query returns within 20ms (awegrzyn#71)
1 parent 4f74b9a commit fbb38c3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎test/testQuery.cxx

+11
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ BOOST_AUTO_TEST_CASE(timeStampVerify)
4040
BOOST_CHECK(diffZone < 1); // 1s
4141
}
4242

43+
BOOST_AUTO_TEST_CASE(queryPerformance)
44+
{
45+
auto influxdb = influxdb::InfluxDBFactory::Get("http://localhost:8086?db=test");
46+
auto t1 = std::chrono::high_resolution_clock::now();
47+
auto points = influxdb->query("SELECT * from test WHERE host = 'localhost'");
48+
BOOST_CHECK(points.size() >= 3);
49+
auto t2 = std::chrono::high_resolution_clock::now();
50+
double duration = std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count();
51+
BOOST_CHECK(duration < 20000);
52+
}
53+
4354
BOOST_AUTO_TEST_CASE(failedQuery1)
4455
{
4556
auto influxdb = influxdb::InfluxDBFactory::Get("http://localhost:8086?db=test");

0 commit comments

Comments
 (0)
Please sign in to comment.