Commit 06a463ea authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

SqliteQuery: Log COUNT request & request duration

parent c7b32d94
......@@ -59,8 +59,12 @@ public:
std::string req = "SELECT COUNT() " + m_base;
auto dbConn = m_ml->getConn();
auto ctx = dbConn->acquireReadContext();
auto chrono = std::chrono::steady_clock::now();
sqlite::Statement stmt( dbConn->handle(), req );
stmt.execute( m_params );
auto duration = std::chrono::steady_clock::now() - chrono;
LOG_DEBUG("Executed ", req, " in ",
std::chrono::duration_cast<std::chrono::microseconds>( duration ).count(), "µs" );
auto row = stmt.row();
row >> m_count;
assert(stmt.row() == nullptr );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment