Skip to content

Commit

Permalink
fix: gather plan_monitor table info (#346)
Browse files Browse the repository at this point in the history
* fix

* fix

* fix
  • Loading branch information
Teingi authored Jul 18, 2024
1 parent 8b1b275 commit 72dc259
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
sed -i 's/pip install -r requirements3.txt/curl https:\/\/bootstrap.pypa.io\/get-pip.py -o get-pip.py\n\
python3 get-pip.py\n\
pip3 install -r requirements3.txt/' ./rpm/oceanbase-diagnostic-tool.spec
python3 -m pip install --upgrade pip wheel
cat ./rpm/oceanbase-diagnostic-tool.spec
python3 -m pip install --upgrade pip setuptools wheel
python3 --version
rpmbuild -bb ./rpm/oceanbase-diagnostic-tool.spec
Expand Down
4 changes: 2 additions & 2 deletions handler/gather/gather_plan_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ def report_schema(self, sql, tenant_name):
handler.handle()
except Exception as e:
pass
table_info_file = os.path.join(self.local_stored_path, "obdiag_tabledump_result_{0}.txt".format(self.gather_timestamp))
self.stdio.print("table info file path:{0}".format(table_info_file))
table_info_file = os.path.join(self.local_stored_path, "obdiag_tabledump_result_{0}.txt".format(TimeUtils.timestamp_to_filename_time(self.gather_timestamp)))
self.stdio.verbose("table info file path:{0}".format(table_info_file))
table_info = self.get_table_info(table_info_file)
if table_info:
schemas = schemas + "<pre style='margin:20px;border:1px solid gray;'>%s</pre>" % table_info
Expand Down
6 changes: 3 additions & 3 deletions handler/gather/gather_tabledump.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ def init(self):
self.table = Util.get_option(options, 'table')
user = Util.get_option(options, 'user')
password = Util.get_option(options, 'password')
if not (self.database and self.table and user):
self.stdio.error("option --database/--table/--user not found, please provide")
return False
store_dir_option = Util.get_option(options, 'store_dir')
if store_dir_option is not None and store_dir_option != './':
if not os.path.exists(os.path.abspath(store_dir_option)):
Expand All @@ -81,6 +78,9 @@ def init(self):
password = self.context.get_variable("gather_password")
if self.context.get_variable("store_dir", None):
self.store_dir = self.context.get_variable("store_dir")
if not (self.database and self.table and user):
self.stdio.error("option --database/--table/--user not found, please provide")
return False
if self.context.get_variable("gather_tenant_name", None):
self.tenant_name = self.context.get_variable("gather_tenant_name")
else:
Expand Down
1 change: 1 addition & 0 deletions requirements3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ sqlgpt-parser>=0.0.1a5
netifaces==0.11.0
netifaces==0.11.0
kubernetes==30.1.0
setuptools==70.3.0

0 comments on commit 72dc259

Please sign in to comment.