Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
Verify in CI that simple query returns within 20ms (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
awegrzyn authored Apr 14, 2020
1 parent 4f74b9a commit fbb38c3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/testQuery.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ BOOST_AUTO_TEST_CASE(timeStampVerify)
BOOST_CHECK(diffZone < 1); // 1s
}

BOOST_AUTO_TEST_CASE(queryPerformance)
{
auto influxdb = influxdb::InfluxDBFactory::Get("http://localhost:8086?db=test");
auto t1 = std::chrono::high_resolution_clock::now();
auto points = influxdb->query("SELECT * from test WHERE host = 'localhost'");
BOOST_CHECK(points.size() >= 3);
auto t2 = std::chrono::high_resolution_clock::now();
double duration = std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count();
BOOST_CHECK(duration < 20000);
}

BOOST_AUTO_TEST_CASE(failedQuery1)
{
auto influxdb = influxdb::InfluxDBFactory::Get("http://localhost:8086?db=test");
Expand Down

0 comments on commit fbb38c3

Please sign in to comment.