diff --git a/cpp/dbpool.cc b/cpp/dbpool.cc index afaaae1..17ff90e 100644 --- a/cpp/dbpool.cc +++ b/cpp/dbpool.cc @@ -118,6 +118,7 @@ namespace f8 while (!terminated_) { CheckDB(); ProcessMsg(); + ++DBPool::Instance()->run_loop_num; WaitLoopCond(); } @@ -167,6 +168,7 @@ namespace f8 AsyncQueryNode *pdelnode = work_node_; work_node_ = work_node_->nextnode; ProcAsyncQuery(pdelnode); + ++DBPool::Instance()->exec_query_num; delete pdelnode; } } @@ -431,6 +433,7 @@ namespace f8 .SetParam1(AQE_CONN_ERROR)); }, &p->timer_attacher.timer_list_); + ++DBPool::Instance()->total_query_num; } private: diff --git a/cpp/dbpool.h b/cpp/dbpool.h index 2d61b26..888c8c8 100644 --- a/cpp/dbpool.h +++ b/cpp/dbpool.h @@ -1,5 +1,7 @@ #pragma once +#include + namespace f8 { typedef std::vector> DataSet; @@ -15,6 +17,9 @@ namespace f8 public: AsyncDBOnErrorFunc on_dberror = nullptr; + std::atomic total_query_num = {0}; + std::atomic exec_query_num = {0}; + std::atomic run_loop_num = {0}; public: void Init();