From 96dfa85a84648eb1fc761bfddb187c55a1c6116a Mon Sep 17 00:00:00 2001 From: silverbullet233 <3675229+silverbullet233@users.noreply.github.com> Date: Thu, 12 Dec 2024 19:33:16 +0800 Subject: [PATCH] fix ut Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com> --- be/src/runtime/lake_tablets_channel.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/be/src/runtime/lake_tablets_channel.cpp b/be/src/runtime/lake_tablets_channel.cpp index 8f61c197b3449..5e0dba2e5a4c1 100644 --- a/be/src/runtime/lake_tablets_channel.cpp +++ b/be/src/runtime/lake_tablets_channel.cpp @@ -292,7 +292,9 @@ Status LakeTabletsChannel::open(const PTabletWriterOpenRequest& params, PTabletW _txn_id = params.txn_id(); _index_id = params.index_id(); _schema = schema; +#ifndef BE_TEST _table_metrics = StarRocksMetrics::instance()->table_metrics(_schema->table_id()); +#endif _is_incremental_channel = is_incremental; if (params.has_lake_tablet_params() && params.lake_tablet_params().has_write_txn_log()) { _finish_mode = params.lake_tablet_params().write_txn_log() ? lake::DeltaWriterFinishMode::kWriteTxnLog @@ -384,6 +386,7 @@ void LakeTabletsChannel::add_chunk(Chunk* chunk, const PTabletWriterAddChunkRequ response->mutable_status()->add_error_msgs("out-of-order packet"); return; } + size_t chunk_size = chunk != nullptr ? chunk->bytes_usage() : 0; auto res = _create_write_context(chunk, request, response); if (!res.ok()) { @@ -551,6 +554,10 @@ void LakeTabletsChannel::add_chunk(Chunk* chunk, const PTabletWriterAddChunkRequ } auto wait_writer_ns = finish_wait_writer_ts - start_wait_writer_ts; +#ifndef BE_TEST + _table_metrics->load_rows.increment(total_row_num); + _table_metrics->load_bytes.increment(chunk_size); +#endif COUNTER_UPDATE(_add_chunk_counter, 1); COUNTER_UPDATE(_add_chunk_timer, watch.elapsed_time()); COUNTER_UPDATE(_add_row_num, total_row_num);