Skip to content

Commit

Permalink
Storages: Refine metrics of read threads and data sharing (#8653) (#8662
Browse files Browse the repository at this point in the history
)

ref #8652
  • Loading branch information
ti-chi-bot authored Jan 8, 2024
1 parent a744148 commit 824059f
Show file tree
Hide file tree
Showing 4 changed files with 381 additions and 6 deletions.
3 changes: 2 additions & 1 deletion dbms/src/Common/TiFlashMetrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,10 @@ namespace DB
F(type_sche_from_cache, {"type", "sche_from_cache"}), \
F(type_sche_new_task, {"type", "sche_new_task"}), \
F(type_ru_exhausted, {"type", "ru_exhausted"}), \
F(type_push_block_bytes, {"type", "push_block_bytes"}), \
F(type_add_cache_succ, {"type", "add_cache_succ"}), \
F(type_add_cache_stale, {"type", "add_cache_stale"}), \
F(type_add_cache_reach_count_limit, {"type", "type_add_cache_reach_count_limit"}), \
F(type_add_cache_reach_count_limit, {"type", "add_cache_reach_count_limit"}), \
F(type_add_cache_total_bytes_limit, {"type", "add_cache_total_bytes_limit"}), \
F(type_get_cache_miss, {"type", "get_cache_miss"}), \
F(type_get_cache_part, {"type", "get_cache_part"}), \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <Common/setThreadName.h>
#include <Storages/DeltaMerge/ReadThread/SegmentReadTaskScheduler.h>
#include <Storages/DeltaMerge/ReadThread/SegmentReader.h>
#include <Storages/DeltaMerge/Segment.h>
Expand Down Expand Up @@ -277,6 +278,7 @@ bool SegmentReadTaskScheduler::schedule()

void SegmentReadTaskScheduler::schedLoop()
{
setThreadName("segment-sched");
while (!isStop())
{
if (!schedule())
Expand Down
4 changes: 3 additions & 1 deletion dbms/src/Storages/DeltaMerge/SegmentReadTaskPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,9 @@ void SegmentReadTaskPool::pushBlock(Block && block)
{
blk_stat.push(block);
global_blk_stat.push(block);
read_bytes_after_last_check += block.bytes();
auto bytes = block.bytes();
read_bytes_after_last_check += bytes;
GET_METRIC(tiflash_storage_read_thread_counter, type_push_block_bytes).Increment(bytes);
q.push(std::move(block), nullptr);
}

Expand Down
Loading

0 comments on commit 824059f

Please sign in to comment.