occupy id positions for profiling.

This commit is contained in:
cqliang1995
2024-02-02 10:42:55 +00:00
committed by ob-robot
parent 0737d86cdd
commit 5acd361739
8 changed files with 1700 additions and 1567 deletions

View File

@ -118,6 +118,8 @@ enum ObSysVarClassType
SYS_VAR_CTE_MAX_RECURSION_DEPTH = 94,
SYS_VAR_REGEXP_STACK_LIMIT = 95,
SYS_VAR_REGEXP_TIME_LIMIT = 96,
SYS_VAR_PROFILING = 97,
SYS_VAR_PROFILING_HISTORY_SIZE = 98,
SYS_VAR_OB_INTERM_RESULT_MEM_LIMIT = 10001,
SYS_VAR_OB_PROXY_PARTITION_HIT = 10002,
SYS_VAR_OB_LOG_LEVEL = 10003,

View File

@ -113,6 +113,8 @@ namespace share
static const char* const OB_SV_CTE_MAX_RECURSION_DEPTH = "cte_max_recursion_depth";
static const char* const OB_SV_REGEXP_STACK_LIMIT = "regexp_stack_limit";
static const char* const OB_SV_REGEXP_TIME_LIMIT = "regexp_time_limit";
static const char* const OB_SV_PROFILING = "profiling";
static const char* const OB_SV_PROFILING_HISTORY_SIZE = "profiling_history_size";
static const char* const OB_SV_INTERM_RESULT_MEM_LIMIT = "ob_interm_result_mem_limit";
static const char* const OB_SV_PROXY_PARTITION_HIT = "ob_proxy_partition_hit";
static const char* const OB_SV_LOG_LEVEL = "ob_log_level";

View File

@ -39,6 +39,11 @@ const char *ObSysVarBinlogFormat::BINLOG_FORMAT_NAMES[] = {
"ROW",
0
};
const char *ObSysVarProfiling::PROFILING_NAMES[] = {
"OFF",
"ON",
0
};
const char *ObSysVarObReadConsistency::OB_READ_CONSISTENCY_NAMES[] = {
"",
"FROZEN",
@ -301,6 +306,8 @@ const char *ObSysVarFactory::SYS_VAR_NAMES_SORTED_BY_NAME[] = {
"plsql_warnings",
"plugin_dir",
"privilege_features_enable",
"profiling",
"profiling_history_size",
"protocol_version",
"query_cache_limit",
"query_cache_min_res_unit",
@ -549,6 +556,8 @@ const ObSysVarClassType ObSysVarFactory::SYS_VAR_IDS_SORTED_BY_NAME[] = {
SYS_VAR_PLSQL_WARNINGS,
SYS_VAR_PLUGIN_DIR,
SYS_VAR_PRIVILEGE_FEATURES_ENABLE,
SYS_VAR_PROFILING,
SYS_VAR_PROFILING_HISTORY_SIZE,
SYS_VAR_PROTOCOL_VERSION,
SYS_VAR_QUERY_CACHE_LIMIT,
SYS_VAR_QUERY_CACHE_MIN_RES_UNIT,
@ -716,6 +725,8 @@ const char *ObSysVarFactory::SYS_VAR_NAMES_SORTED_BY_ID[] = {
"cte_max_recursion_depth",
"regexp_stack_limit",
"regexp_time_limit",
"profiling",
"profiling_history_size",
"ob_interm_result_mem_limit",
"ob_proxy_partition_hit",
"ob_log_level",
@ -1129,6 +1140,8 @@ int ObSysVarFactory::create_all_sys_vars()
+ sizeof(ObSysVarCteMaxRecursionDepth)
+ sizeof(ObSysVarRegexpStackLimit)
+ sizeof(ObSysVarRegexpTimeLimit)
+ sizeof(ObSysVarProfiling)
+ sizeof(ObSysVarProfilingHistorySize)
+ sizeof(ObSysVarObIntermResultMemLimit)
+ sizeof(ObSysVarObProxyPartitionHit)
+ sizeof(ObSysVarObLogLevel)
@ -2158,6 +2171,24 @@ int ObSysVarFactory::create_all_sys_vars()
ptr = (void *)((char *)ptr + sizeof(ObSysVarRegexpTimeLimit));
}
}
if (OB_SUCC(ret)) {
if (OB_ISNULL(sys_var_ptr = new (ptr)ObSysVarProfiling())) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_ERROR("fail to new ObSysVarProfiling", K(ret));
} else {
store_buf_[ObSysVarsToIdxMap::get_store_idx(static_cast<int64_t>(SYS_VAR_PROFILING))] = sys_var_ptr;
ptr = (void *)((char *)ptr + sizeof(ObSysVarProfiling));
}
}
if (OB_SUCC(ret)) {
if (OB_ISNULL(sys_var_ptr = new (ptr)ObSysVarProfilingHistorySize())) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_ERROR("fail to new ObSysVarProfilingHistorySize", K(ret));
} else {
store_buf_[ObSysVarsToIdxMap::get_store_idx(static_cast<int64_t>(SYS_VAR_PROFILING_HISTORY_SIZE))] = sys_var_ptr;
ptr = (void *)((char *)ptr + sizeof(ObSysVarProfilingHistorySize));
}
}
if (OB_SUCC(ret)) {
if (OB_ISNULL(sys_var_ptr = new (ptr)ObSysVarObIntermResultMemLimit())) {
ret = OB_ALLOCATE_MEMORY_FAILED;
@ -4567,6 +4598,28 @@ int ObSysVarFactory::create_sys_var(ObIAllocator &allocator_, ObSysVarClassType
}
break;
}
case SYS_VAR_PROFILING: {
void *ptr = NULL;
if (OB_ISNULL(ptr = allocator_.alloc(sizeof(ObSysVarProfiling)))) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_ERROR("fail to alloc memory", K(ret), K(sizeof(ObSysVarProfiling)));
} else if (OB_ISNULL(sys_var_ptr = new (ptr)ObSysVarProfiling())) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_ERROR("fail to new ObSysVarProfiling", K(ret));
}
break;
}
case SYS_VAR_PROFILING_HISTORY_SIZE: {
void *ptr = NULL;
if (OB_ISNULL(ptr = allocator_.alloc(sizeof(ObSysVarProfilingHistorySize)))) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_ERROR("fail to alloc memory", K(ret), K(sizeof(ObSysVarProfilingHistorySize)));
} else if (OB_ISNULL(sys_var_ptr = new (ptr)ObSysVarProfilingHistorySize())) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_ERROR("fail to new ObSysVarProfilingHistorySize", K(ret));
}
break;
}
case SYS_VAR_OB_INTERM_RESULT_MEM_LIMIT: {
void *ptr = NULL;
if (OB_ISNULL(ptr = allocator_.alloc(sizeof(ObSysVarObIntermResultMemLimit)))) {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -837,7 +837,7 @@
"have_profiling": {
"id": 55,
"name": "have_profiling",
"default_value": "YES",
"default_value": "NO",
"base_value": "YES",
"data_type": "varchar",
"info": "",
@ -1404,6 +1404,36 @@
"background_cn": "",
"ref_url": ""
},
"profiling": {
"id": 97,
"name": "profiling",
"default_value": "0",
"base_value": "0",
"data_type": "enum",
"info": "",
"flags": "GLOBAL | SESSION | MYSQL_ONLY",
"enum_names": [
"OFF",
"ON"
],
"publish_version": "",
"info_cn": "",
"background_cn": "",
"ref_url": ""
},
"profiling_history_size": {
"id": 98,
"name": "profiling_history_size",
"default_value": "15",
"base_value": "15",
"data_type": "int",
"info": "",
"flags": "GLOBAL | SESSION | MYSQL_ONLY",
"publish_version": "",
"info_cn": "",
"background_cn": "",
"ref_url": ""
},
"ob_interm_result_mem_limit": {
"id": 10001,
"name": "ob_interm_result_mem_limit",