Skip to content

Commit 14bcfab

Browse files
committed
add bvar ready_to_run_skip_signal_task_per_second
1 parent 0ab0b69 commit 14bcfab

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/bthread/task_group.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ void TaskGroup::ending_sched(TaskGroup** pg) {
571571
void TaskGroup::sched(TaskGroup** pg) {
572572
TaskGroup* g = *pg;
573573
bthread_t next_tid = 0;
574-
574+
575575
if (!g->pop_resume_task(&next_tid)) {
576576
// Find next task to run, if none, switch to idle thread of the group.
577577
#ifndef BTHREAD_FAIR_WSQ
@@ -670,10 +670,15 @@ void TaskGroup::destroy_self() {
670670
}
671671
}
672672

673+
bvar::Adder<int64_t> ready_to_run_skip_cnt;
674+
bvar::PerSecond<bvar::Adder<int64_t>> ready_to_run_skip_ps(
675+
"ready_to_run_skip_signal_task_per_second",
676+
&ready_to_run_skip_cnt, 2);
673677
void TaskGroup::ready_to_run(bthread_t tid, bool nosignal) {
674678
push_rq(tid);
675679
if (nosignal || ParkingLot::_waiting_worker_count == 0) {
676680
++_num_nosignal;
681+
ready_to_run_skip_cnt << 1;
677682
} else {
678683
const int additional_signal = _num_nosignal;
679684
_num_nosignal = 0;

0 commit comments

Comments
 (0)