Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: fuzhe1989 <[email protected]>
  • Loading branch information
fuzhe1989 committed Mar 17, 2022
1 parent 392d7d2 commit d58f804
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dbms/src/Common/TiFlashMetrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ namespace DB
F(type_max_threads_of_raw, {"type", "total_max"}), \
F(type_total_threads_of_raw, {"type", "total"}), \
F(type_threads_of_client_cq_pool, {"type", "rpc_client_cq_pool"}), \
F(type_threads_of_receiver_read_loop, {"type", "rpc_receiver_read_loop"}), \
F(type_threads_of_receiver_reactor, {"type", "rpc_receiver_reactor"}), \
F(type_max_threads_of_establish_mpp, {"type", "rpc_establish_mpp_max"}), \
F(type_active_threads_of_establish_mpp, {"type", "rpc_establish_mpp"}), \
F(type_max_threads_of_dispatch_mpp, {"type", "rpc_dispatch_mpp_max"}), \
Expand Down
12 changes: 12 additions & 0 deletions dbms/src/Flash/Mpp/ExchangeReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include <Common/CPUAffinityManager.h>
#include <Common/ThreadFactory.h>
#include <Common/TiFlashMetrics.h>
#include <Flash/Coprocessor/CoprocessorReader.h>
#include <Flash/Mpp/ExchangeReceiver.h>
#include <Flash/Mpp/MPPTunnel.h>
Expand Down Expand Up @@ -350,6 +351,12 @@ template <typename RPCContext>
void ExchangeReceiverBase<RPCContext>::reactor(const std::vector<Request> & async_requests)
{
using AsyncHandler = AsyncRequestHandler<RPCContext>;

GET_METRIC(tiflash_thread_count, type_threads_of_receiver_reactor).Increment();
SCOPE_EXIT({
GET_METRIC(tiflash_thread_count, type_threads_of_receiver_reactor).Decrement();
});

CPUAffinityManager::getInstance().bindSelfQueryThread();

size_t alive_async_connections = async_requests.size();
Expand Down Expand Up @@ -406,6 +413,11 @@ void ExchangeReceiverBase<RPCContext>::reactor(const std::vector<Request> & asyn
template <typename RPCContext>
void ExchangeReceiverBase<RPCContext>::readLoop(const Request & req)
{
GET_METRIC(tiflash_thread_count, type_threads_of_receiver_read_loop).Increment();
SCOPE_EXIT({
GET_METRIC(tiflash_thread_count, type_threads_of_receiver_read_loop).Decrement();
});

CPUAffinityManager::getInstance().bindSelfQueryThread();
bool meet_error = false;
String local_err_msg;
Expand Down

0 comments on commit d58f804

Please sign in to comment.