Skip to content

Commit

Permalink
Make some FAP metrics more clear (pingcap#322)
Browse files Browse the repository at this point in the history
Signed-off-by: Calvin Neo <calvinneo1995@gmail.com>
  • Loading branch information
CalvinNeo authored Dec 3, 2024
1 parent 0a7ffb4 commit 8333d4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions dbms/src/Common/TiFlashMetrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ namespace DB
F(type_failed_other, {{"type", "failed_other"}}), \
F(type_failed_cancel, {{"type", "failed_cancel"}}), \
F(type_failed_no_suitable, {{"type", "failed_no_suitable"}}), \
F(type_failed_no_candidate, {{"type", "failed_no_candidate"}}), \
F(type_failed_timeout, {{"type", "failed_timeout"}}), \
F(type_failed_baddata, {{"type", "failed_baddata"}}), \
F(type_failed_repeated, {{"type", "failed_repeated"}}), \
Expand Down
4 changes: 2 additions & 2 deletions dbms/src/Storages/KVStore/MultiRaft/Disagg/FastAddPeer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ std::variant<CheckpointRegionInfoAndData, FastAddPeerRes> FastAddPeerImplSelect(
if (candidate_store_ids.empty())
{
LOG_DEBUG(log, "No suitable candidate peer for region_id={}", region_id);
GET_METRIC(tiflash_fap_task_result, type_failed_no_suitable).Increment();
GET_METRIC(tiflash_fap_task_result, type_failed_no_candidate).Increment();
return genFastAddPeerResFail(FastAddPeerStatus::NoSuitable);
}
LOG_DEBUG(log, "Begin to select checkpoint for region_id={}", region_id);
Expand Down Expand Up @@ -707,6 +707,7 @@ FastAddPeerRes FastAddPeer(EngineStoreServerWrap * server, uint64_t region_id, u
// We need to schedule the task.
auto current_time = FAPAsyncTasks::getCurrentMillis();
GET_METRIC(tiflash_fap_task_state, type_queueing_stage).Increment();
GET_METRIC(tiflash_fap_task_result, type_total).Increment();
auto job_func = [server, region_id, new_peer_id, fap_ctx, current_time]() {
std::string origin_name = getThreadName();
SCOPE_EXIT({ setThreadName(origin_name.c_str()); });
Expand Down Expand Up @@ -760,7 +761,6 @@ FastAddPeerRes FastAddPeer(EngineStoreServerWrap * server, uint64_t region_id, u
new_peer_id,
region_id,
elapsed);
GET_METRIC(tiflash_fap_task_result, type_total).Increment();
GET_METRIC(tiflash_fap_task_duration_seconds, type_phase1_total).Observe(elapsed / 1000.0);
return result;
}
Expand Down

0 comments on commit 8333d4f

Please sign in to comment.