From 258aec360d17dd869c6483513e977970f71beb1a Mon Sep 17 00:00:00 2001 From: Calvin Neo Date: Mon, 23 Sep 2024 13:12:30 +0800 Subject: [PATCH] trace Signed-off-by: Calvin Neo --- dbms/src/Common/TiFlashMetrics.h | 1 + dbms/src/Storages/DeltaMerge/Segment.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/dbms/src/Common/TiFlashMetrics.h b/dbms/src/Common/TiFlashMetrics.h index b466a021965..1e4e0a61e99 100644 --- a/dbms/src/Common/TiFlashMetrics.h +++ b/dbms/src/Common/TiFlashMetrics.h @@ -404,6 +404,7 @@ static_assert(RAFT_REGION_BIG_WRITE_THRES * 4 < RAFT_REGION_BIG_WRITE_MAX, "Inva F(type_failed_baddata, {{"type", "failed_baddata"}}), \ F(type_failed_repeated, {{"type", "failed_repeated"}}), \ F(type_failed_build_chkpt, {{"type", "failed_build_chkpt"}}), \ + F(type_reuse_chkpt_cache, {{"type", "reuse_chkpt_cache"}}), \ F(type_restore, {{"type", "restore"}}), \ F(type_succeed, {{"type", "succeed"}})) \ M(tiflash_fap_task_state, \ diff --git a/dbms/src/Storages/DeltaMerge/Segment.cpp b/dbms/src/Storages/DeltaMerge/Segment.cpp index a2402b66b64..85b9056c69a 100644 --- a/dbms/src/Storages/DeltaMerge/Segment.cpp +++ b/dbms/src/Storages/DeltaMerge/Segment.cpp @@ -544,6 +544,7 @@ Segment::SegmentMetaInfos Segment::readAllSegmentsMetaInfoInRange( // auto lock = end_to_segment_id_cache->readLock(); bool is_cache_ready = end_to_segment_id_cache->isReady(lock); RUNTIME_CHECK(is_cache_ready, checkpoint_info->region_id, context.keyspace_id, context.physical_table_id); + GET_METRIC(tiflash_fap_task_result, type_reuse_chkpt_cache).Increment(); // ... then we could seek to `current_segment_id` in cache to avoid some read. auto current_segment_id = end_to_segment_id_cache->getSegmentIdContainingKey(lock, target_range.getStart().toRowKeyValue());