Skip to content

Commit

Permalink
obdiag analyze memory update (#558)
Browse files Browse the repository at this point in the history
* obdiag analyze memory update

* obdiag analyze memory update

* obdiag analyze memory update

* obdiag analyze memory update

* obdiag analyze memory update
  • Loading branch information
Teingi authored Nov 15, 2024
1 parent b11acae commit 4f5a608
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 177 deletions.
5 changes: 5 additions & 0 deletions core.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,12 @@ def analyze_fuction(self, function_type, opt):
self.set_context(function_type, 'analyze', config)
handler = AnalyzeIndexSpaceHandler(self.context)
return handler.handle()
elif function_type == 'analyze_memory_offline':
self.set_context_skip_cluster_conn(function_type, 'analyze', config)
handler = AnalyzeMemoryHandler(self.context)
return handler.handle()
elif function_type == 'analyze_memory':
self.update_obcluster_nodes(config)
self.set_context(function_type, 'analyze', config)
handler = AnalyzeMemoryHandler(self.context)
return handler.handle()
Expand Down
3 changes: 1 addition & 2 deletions diag_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,6 @@ def __init__(self):
super(ObdiagAnalyzeMemoryCommand, self).__init__('memory', 'Analyze OceanBase Memory info from online observer machines or offline OceanBase log files')
self.parser.add_option('--from', type='string', help="specify the start of the time range. format: 'yyyy-mm-dd hh:mm:ss'")
self.parser.add_option('--to', type='string', help="specify the end of the time range. format: 'yyyy-mm-dd hh:mm:ss'")
self.parser.add_option('--grep', action="append", type='string', help="specify keywords constrain")
self.parser.add_option('--files', action="append", type='string', help="specify files")
self.parser.add_option('--store_dir', type='string', help='the dir to store gather result, current dir by default.', default='./')
self.parser.add_option('--since', type='string', help="Specify time range that from 'n' [d]ays, 'n' [h]ours or 'n' [m]inutes. before to now. format: <n> <m|h|d>. example: 1h.", default='30m')
Expand All @@ -942,7 +941,7 @@ def init(self, cmd, args):
def _do_command(self, obdiag):
offline_args_sign = '--files'
if self.args and (offline_args_sign in self.args):
return obdiag.analyze_fuction('analyze_memory', self.opts)
return obdiag.analyze_fuction('analyze_memory_offline', self.opts)
else:
return obdiag.analyze_fuction('analyze_memory', self.opts)

Expand Down
Loading

0 comments on commit 4f5a608

Please sign in to comment.