sql_monitor change time expression from cpu_cycle to time_us

This commit is contained in:
obdev
2023-04-04 03:11:24 +00:00
committed by ob-robot
parent ba4460ca3f
commit 4708d356a7
5 changed files with 97 additions and 7 deletions

View File

@ -14,6 +14,7 @@
#include "lib/ob_running_mode.h"
#include "util/easy_time.h"
#include "lib/rc/ob_rc.h"
#include "observer/ob_server.h"
namespace oceanbase
{
@ -132,8 +133,7 @@ int ObPlanRealInfoMgr::handle_plan_info(int64_t id,
SERVER_LOG(WARN, "alloc mem failed", K(total_size), K(ret));
}
} else {
uint64_t cpu_khz = get_cpufreq_khz();
cpu_khz = cpu_khz < 1 ? 1 : cpu_khz;
uint64_t cpu_khz = OBSERVER.get_cpu_frequency_khz();
int64_t row_count = plan_info.output_row_count_;
int64_t cpu_time = plan_info.db_time_*1000 / cpu_khz;
int64_t io_time = plan_info.block_time_*1000 / cpu_khz;