[CP] [BUG FIX] Fix the problem that the wait event statistic item in sql audit is always 0

This commit is contained in:
AntiTopQuark
2024-01-22 10:42:44 +00:00
committed by ob-robot
parent 7acad5e931
commit fe8bffc7e6
3 changed files with 28 additions and 1 deletions

View File

@ -549,6 +549,27 @@ int ObDiagnoseSessionInfo::notify_wait_end(ObDiagnoseTenantInfo *tenant_info, co
}
}
}
switch (OB_WAIT_EVENTS[event_desc->event_no_].wait_class_) {
case ObWaitClassIds::CONCURRENCY:{
EVENT_ADD(ObStatEventIds::CCWAIT_TIME, event_desc->wait_time_);
break;
}
case ObWaitClassIds::USER_IO:{
EVENT_ADD(ObStatEventIds::USER_IO_WAIT_TIME, event_desc->wait_time_);
break;
}
case ObWaitClassIds::APPLICATION:{
EVENT_ADD(ObStatEventIds::APWAIT_TIME, event_desc->wait_time_);
break;
}
case ObWaitClassIds::SCHEDULER:{
EVENT_ADD(ObStatEventIds::SCHEDULE_WAIT_TIME, event_desc->wait_time_);
break;
}
default:
break;
}
if (!is_atomic) {
//LOG_ERROR("XXXX: end wait", "id", ObActiveSessionGuard::get_stat().id_,
// K(event_desc->wait_time_), K(event_desc->event_no_));

View File

@ -901,7 +901,7 @@ int ObGvSqlAudit::fill_cells(obmysql::ObMySQLRequestRecord &record)
cells[cell_idx].set_uint64(record.data_.exec_record_.user_io_time_);
} break;
case SCHEDULE_TIME: {
cells[cell_idx].set_uint64(0);
cells[cell_idx].set_uint64(record.data_.exec_record_.schedule_time_);
} break;
case ROW_CACHE_HIT: {
cells[cell_idx].set_int(record.data_.exec_record_.row_cache_hit_);

View File

@ -32,6 +32,7 @@ EVENT_INFO(BLOCKSCAN_BLOCK_CNT, blockscan_block_cnt)
EVENT_INFO(BLOCKSCAN_ROW_CNT, blockscan_row_cnt)
EVENT_INFO(PUSHDOWN_STORAGE_FILTER_ROW_CNT, pushdown_storage_filter_row_cnt)
EVENT_INFO(FUSE_ROW_CACHE_HIT, fuse_row_cache_hit)
EVENT_INFO(SCHEDULE_TIME, schedule_time)
#endif
#ifndef OCEANBASE_SQL_OB_EXEC_STAT_H
@ -100,6 +101,10 @@ struct ObExecRecord
blockscan_row_cnt_##se##_ = EVENT_STAT_GET(arr, ObStatEventIds::BLOCKSCAN_ROW_CNT); \
pushdown_storage_filter_row_cnt_##se##_ = EVENT_STAT_GET(arr, ObStatEventIds::PUSHDOWN_STORAGE_FILTER_ROW_CNT); \
fuse_row_cache_hit_##se##_= EVENT_STAT_GET(arr, ObStatEventIds::FUSE_ROW_CACHE_HIT); \
user_io_time_##se##_ = EVENT_STAT_GET(arr, ObStatEventIds::USER_IO_WAIT_TIME); \
application_time_##se##_ = EVENT_STAT_GET(arr, ObStatEventIds::APWAIT_TIME); \
concurrency_time_##se##_ = EVENT_STAT_GET(arr, ObStatEventIds::CCWAIT_TIME); \
schedule_time_##se##_ = EVENT_STAT_GET(arr, ObStatEventIds::SCHEDULE_WAIT_TIME); \
} \
} while(0);
@ -129,6 +134,7 @@ struct ObExecRecord
UPDATE_EVENT(user_io_time);
UPDATE_EVENT(concurrency_time);
UPDATE_EVENT(application_time);
UPDATE_EVENT(schedule_time);
UPDATE_EVENT(memstore_read_row_count);
UPDATE_EVENT(ssstore_read_row_count);
UPDATE_EVENT(data_block_read_cnt);