[CP] record spm stats after plan execution even enable_perf_event parameter is disabled

This commit is contained in:
obdev
2024-05-11 10:18:00 +00:00
committed by ob-robot
parent 4278d1af7c
commit 2ff8588a15
2 changed files with 15 additions and 6 deletions

View File

@ -491,6 +491,15 @@ void ObPhysicalPlan::update_plan_stat(const ObAuditRecordData &record,
} else {
ATOMIC_INC(&(stat_.hit_count_));
}
if (ATOMIC_LOAD(&stat_.is_evolution_)) { //for spm
ATOMIC_INC(&(stat_.evolution_stat_.executions_));
// ATOMIC_AAF(&(stat_.evolution_stat_.cpu_time_),
// record.get_elapsed_time() - record.exec_record_.wait_time_end_
// - (record.exec_timestamp_.run_ts_ - record.exec_timestamp_.receive_ts_));
ATOMIC_AAF(&(stat_.evolution_stat_.cpu_time_), record.exec_timestamp_.executor_t_);
ATOMIC_AAF(&(stat_.evolution_stat_.elapsed_time_), record.get_elapsed_time());
ATOMIC_STORE(&(stat_.evolution_stat_.last_exec_ts_), record.exec_timestamp_.executor_end_ts_);
}
} else { // long route stat begin
execute_count = ATOMIC_AAF(&stat_.execute_times_, 1);
ATOMIC_AAF(&(stat_.total_process_time_), record.get_process_time());