Skip to content

Commit

Permalink
修改重复项和描述
Browse files Browse the repository at this point in the history
  • Loading branch information
oraclebird committed Jul 16, 2024
1 parent cb89f3c commit 10280f5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 34 deletions.
22 changes: 0 additions & 22 deletions core.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
from err import CheckStatus, SUG_SSH_FAILED
from handler.analyzer.analyze_flt_trace import AnalyzeFltTraceHandler
from handler.analyzer.analyze_log import AnalyzeLogHandler
from handler.analyzer.analyze_parameter import AnalyzeParameterHandler
from handler.analyzer.analyze_variable import AnalyzeVariableHandler
from handler.analyzer.analyze_sql import AnalyzeSQLHandler
from handler.analyzer.analyze_sql_review import AnalyzeSQLReviewHandler
from handler.analyzer.analyze_parameter import AnalyzeParameterHandler
Expand All @@ -50,8 +48,6 @@
from handler.gather.gather_plan_monitor import GatherPlanMonitorHandler
from handler.gather.gather_scenes import GatherSceneHandler
from handler.gather.scenes.list import GatherScenesListHandler
from handler.gather.gather_parameters import GatherParametersHandler
from handler.gather.gather_variables import GatherVariablesHandler
from handler.gather.gather_tabledump import GatherTableDumpHandler
from handler.gather.gather_parameters import GatherParametersHandler
from handler.gather.gather_variables import GatherVariablesHandler
Expand Down Expand Up @@ -250,12 +246,6 @@ def gather_function(self, function_type, opt):
elif function_type == 'gather_variables':
handler = GatherVariablesHandler(self.context)
return handler.handle()
elif function_type == 'gather_parameters':
handler = GatherParametersHandler(self.context)
return handler.handle()
elif function_type == 'gather_variables':
handler = GatherVariablesHandler(self.context)
return handler.handle()
else:
self._call_stdio('error', 'Not support gather function: {0}'.format(function_type))
return False
Expand Down Expand Up @@ -314,18 +304,6 @@ def analyze_fuction(self, function_type, opt):
self.set_context(function_type, 'analyze', config)
handler = AnalyzeSQLReviewHandler(self.context)
handler.handle()
elif function_type == 'analyze_parameter_non_default':
self.set_context(function_type, 'analyze', config)
handler = AnalyzeParameterHandler(self.context, 'non_default')
handler.handle()
elif function_type == 'analyze_parameter_diff':
self.set_context_skip_cluster_conn(function_type, 'analyze', config)
handler = AnalyzeParameterHandler(self.context, 'diff')
handler.handle()
elif function_type == 'analyze_variable':
self.set_context(function_type, 'analyze', config)
handler = AnalyzeVariableHandler(self.context)
handler.handle()
else:
self._call_stdio('error', 'Not support analyze function: {0}'.format(function_type))
return False
Expand Down
8 changes: 4 additions & 4 deletions handler/analyzer/analyze_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def get_version(self):
try:
observer_version = get_observer_version_by_sql(self.ob_cluster, self.stdio)
except Exception as e:
self.stdio.warn("AnalyzeHandler Failed to get observer version:{0}".format(e))
self.stdio.verbose("AnalyzeHandler.init get observer version: {0}".format(observer_version))
self.stdio.warn("failed to get observer version:{0}".format(e))
self.stdio.verbose("get observer version: {0}".format(observer_version))
return observer_version

def handle(self):
Expand Down Expand Up @@ -98,7 +98,7 @@ def init_option_default(self):
offline_file_option = Util.get_option(options, 'file')
if store_dir_option and store_dir_option != "./":
if not os.path.exists(os.path.abspath(store_dir_option)):
self.stdio.warn('warn: args --store_dir [{0}] incorrect: No such directory, Now create it'.format(os.path.abspath(store_dir_option)))
self.stdio.warn('args --store_dir [{0}] incorrect: No such directory, Now create it'.format(os.path.abspath(store_dir_option)))
os.makedirs(os.path.abspath(store_dir_option))
self.export_report_path = os.path.abspath(store_dir_option)
else:
Expand All @@ -122,7 +122,7 @@ def init_option_diff(self):
offline_file_option = Util.get_option(options, 'file')
if store_dir_option and store_dir_option != "./":
if not os.path.exists(os.path.abspath(store_dir_option)):
self.stdio.warn('warn: args --store_dir [{0}] incorrect: No such directory, Now create it'.format(os.path.abspath(store_dir_option)))
self.stdio.warn('args --store_dir [{0}] incorrect: No such directory, Now create it'.format(os.path.abspath(store_dir_option)))
os.makedirs(os.path.abspath(store_dir_option))
self.export_report_path = os.path.abspath(store_dir_option)
else:
Expand Down
2 changes: 1 addition & 1 deletion handler/analyzer/analyze_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def init_option(self):

if store_dir_option and store_dir_option != "./":
if not os.path.exists(os.path.abspath(store_dir_option)):
self.stdio.warn('warn: args --store_dir [{0}] incorrect: No such directory, Now create it'.format(os.path.abspath(store_dir_option)))
self.stdio.warn('args --store_dir [{0}] incorrect: No such directory, Now create it'.format(os.path.abspath(store_dir_option)))
os.makedirs(os.path.abspath(store_dir_option))
self.export_report_path = os.path.abspath(store_dir_option)
else:
Expand Down
10 changes: 5 additions & 5 deletions handler/gather/gather_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def init_option(self):
store_dir_option = Util.get_option(options, 'store_dir')
if store_dir_option and store_dir_option != "./":
if not os.path.exists(os.path.abspath(store_dir_option)):
self.stdio.warn('warn: args --store_dir [{0}] incorrect: No such directory, Now create it'.format(os.path.abspath(store_dir_option)))
self.stdio.warn('args --store_dir [{0}] incorrect: No such directory, Now create it'.format(os.path.abspath(store_dir_option)))
os.makedirs(os.path.abspath(store_dir_option))
self.gather_pack_dir = os.path.abspath(store_dir_option)
return True
Expand All @@ -76,8 +76,8 @@ def get_version(self):
try:
observer_version = get_observer_version_by_sql(self.ob_cluster, self.stdio)
except Exception as e:
self.stdio.warn("GatherHandler Failed to get observer version:{0}".format(e))
self.stdio.verbose("GatherHandler.init get observer version: {0}".format(observer_version))
self.stdio.warn("failed to get observer version:{0}".format(e))
self.stdio.verbose("get observer version: {0}".format(observer_version))
return observer_version

def get_cluster_name(self):
Expand All @@ -87,8 +87,8 @@ def get_cluster_name(self):
cluster_info = self.obconn.execute_sql(sql)
cluster_name = cluster_info[0][0]
except Exception as e:
self.stdio.warn("RCAHandler Failed to get oceanbase cluster name:{0}".format(e))
self.stdio.verbose("RCAHandler.init get oceanbase cluster name {0}".format(cluster_name))
self.stdio.warn("failed to get oceanbase cluster name:{0}".format(e))
self.stdio.verbose("get oceanbase cluster name {0}".format(cluster_name))
return cluster_name

def get_parameters_info(self):
Expand Down
4 changes: 2 additions & 2 deletions handler/gather/gather_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ def get_cluster_name(self):
cluster_info = self.obconn.execute_sql(sql)
cluster_name = cluster_info[0][0]
except Exception as e:
self.stdio.warn("RCAHandler Failed to get oceanbase cluster name:{0}".format(e))
self.stdio.verbose("RCAHandler.init get oceanbase cluster name {0}".format(cluster_name))
self.stdio.warn("failed to get oceanbase cluster name:{0}".format(e))
self.stdio.verbose("get oceanbase cluster name {0}".format(cluster_name))
return cluster_name

def get_variables_info(self):
Expand Down

0 comments on commit 10280f5

Please sign in to comment.