Skip to content

Commit

Permalink
Add DEBUG_CPOLL debug log for connection pool.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengshuxin committed Aug 21, 2024
1 parent 775cae7 commit 11ac10a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib_acl_cpp/src/acl_stdafx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@
#define ACL_CPP_DEBUG_CONN_MANAGER 41
#define ACL_CPP_DEBUG_HTTP_NET 42
#define DEBUG_MQTT 43
#define DEBUG_CPOLL 44
#define ACL_CPP_DEBUG_MAX 70
12 changes: 8 additions & 4 deletions lib_acl_cpp/src/connpool/connect_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,10 @@ size_t connect_pool::check_dead(size_t count, thread_pool& threads)
struct timeval end;
gettimeofday(&end, NULL);
double tc = stamp_sub(end, begin);
logger("Addr: %s; threads: limit=%zd, count=%d; jobs count=%zd, %zd, time cost=%.2f ms",
addr_, threads.get_limit(), threads.threads_count(), jobs.size(), count, tc);
logger_debug(DEBUG_CPOLL, 1, "Addr: %s; threads: limit=%zd, count=%d;"
" jobs count=%zd, %zd, time cost=%.2f ms",
addr_, threads.get_limit(), threads.threads_count(),
jobs.size(), count, tc);

for (std::vector<check_job*>::iterator it = jobs.begin();
it != jobs.end(); ++it) {
Expand Down Expand Up @@ -729,8 +731,10 @@ void connect_pool::keep_conns(size_t min, thread_pool& threads)
struct timeval end;
gettimeofday(&end, NULL);
double tc = stamp_sub(end, begin);
logger("Addr=%s; threads: limit=%zd, count=%d; jobs count=%zd, time cost=%.2f ms",
addr_, threads.get_limit(), threads.threads_count(), jobs.size(), tc);
logger_debug(DEBUG_CPOLL, 1, "Addr=%s; threads: limit=%zd, count=%d;"
" jobs count=%zd, time cost=%.2f ms",
addr_, threads.get_limit(), threads.threads_count(),
jobs.size(), tc);

for (std::vector<check_job*>::iterator it = jobs.begin();
it != jobs.end(); ++it) {
Expand Down

0 comments on commit 11ac10a

Please sign in to comment.