[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

@ -43,9 +43,9 @@ public:
{ {
is_inited_ = false; is_inited_ = false;
array_ = NULL; array_ = NULL;
bitset_.reuse(); bitset_.reuse();
} }
void clear() void clear()
{ {
bitset_.reuse(); bitset_.reuse();
} }
@ -123,9 +123,9 @@ public:
is_new_mask = tmp_new_mask; is_new_mask = tmp_new_mask;
} }
} }
} }
return ret; return ret;
} }
bool is_all_mask() const bool is_all_mask() const
{ {
bool bool_ret = false; bool bool_ret = false;

View File

@ -491,6 +491,15 @@ void ObPhysicalPlan::update_plan_stat(const ObAuditRecordData &record,
} else { } else {
ATOMIC_INC(&(stat_.hit_count_)); 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 } else { // long route stat begin
execute_count = ATOMIC_AAF(&stat_.execute_times_, 1); execute_count = ATOMIC_AAF(&stat_.execute_times_, 1);
ATOMIC_AAF(&(stat_.total_process_time_), record.get_process_time()); ATOMIC_AAF(&(stat_.total_process_time_), record.get_process_time());