[CP] SQL execution time consumption statistics

This commit is contained in:
obdev
2023-02-09 14:28:54 +00:00
committed by ob-robot
parent 8ee348c40d
commit 6192a06fb9
9 changed files with 42 additions and 3 deletions

View File

@ -3966,6 +3966,23 @@ int64_t ObSqlFatalErrExtraInfoGuard::to_string(char *buf, const int64_t buf_len)
return pos;
}
void ObSQLUtils::record_execute_time(const ObPhyPlanType type,
const int64_t time_cost)
{
#define ADD_EXECUTE_TIME(type) \
case OB_PHY_PLAN_##type: \
EVENT_ADD(SQL_##type##_TIME, time_cost); \
break
switch(type)
{
ADD_EXECUTE_TIME(LOCAL);
ADD_EXECUTE_TIME(REMOTE);
ADD_EXECUTE_TIME(DISTRIBUTED);
default: {}
}
#undef ADD_EXECUTE_TIME
}
int ObSQLUtils::handle_audit_record(bool need_retry,
const ObExecuteMode exec_mode,
ObSQLSessionInfo &session,