Skip to content

Commit

Permalink
Distinguish different vector index build type (pingcap#320)
Browse files Browse the repository at this point in the history
Signed-off-by: Calvin Neo <[email protected]>
  • Loading branch information
CalvinNeo authored and ti-chi-bot committed Jan 7, 2025
1 parent caf7b84 commit 78e6d33
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dbms/src/Common/TiFlashMetrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,11 @@ static_assert(RAFT_REGION_BIG_WRITE_THRES * 4 < RAFT_REGION_BIG_WRITE_MAX, "Inva
Gauge, \
F(type_build, {"type", "build"}), \
F(type_view, {"type", "view"})) \
M(tiflash_vector_index_build_count, \
"Vector index build count", \
Counter, \
F(type_stable, {"type", "stable"}), \
F(type_delta, {"type", "delta"})) \
M(tiflash_vector_index_active_instances, \
"Active Vector index instances", \
Gauge, \
Expand Down
5 changes: 5 additions & 0 deletions dbms/src/Storages/DeltaMerge/LocalIndexerScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

#include <Common/Exception.h>
#include <Common/TiFlashMetrics.h>
#include <Common/setThreadName.h>
#include <Storages/DeltaMerge/LocalIndexerScheduler.h>
#include <common/logger_useful.h>
Expand Down Expand Up @@ -194,6 +195,10 @@ void LocalIndexerScheduler::taskOnSchedule(std::unique_lock<std::mutex> &, const
{
for (const auto & file_id : task->user_task.file_ids)
{
if (std::holds_alternative<DMFileID>(file_id))
GET_METRIC(tiflash_vector_index_build_count, type_stable).Increment(1);
else
GET_METRIC(tiflash_vector_index_build_count, type_delta).Increment(1);
auto [it, inserted] = adding_index_page_id_set.insert(file_id);
RUNTIME_CHECK(inserted);
UNUSED(it);
Expand Down

0 comments on commit 78e6d33

Please sign in to comment.