Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed: analyze memory #642

Merged
merged 9 commits into from
Dec 19, 2024
6 changes: 3 additions & 3 deletions src/handler/analyzer/analyze_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
import tabulate
import threading
import uuid
from src import common as ssh_client_local_client
from src.common.command import get_observer_version_by_sql
from src.common.tool import DirectoryUtil, TimeUtils, Util, NetUtils, FileUtil
from src.common.obdiag_exception import OBDIAGFormatException
from src.common.constant import const
from src.common.command import download_file, get_logfile_name_list, mkdir, delete_file
from src.common.command import SshClient
from src.common.ssh_client.local_client import LocalClient
from src.common.result_type import ObdiagResult


Expand Down Expand Up @@ -537,7 +537,7 @@ def __pharse_offline_log_file(self, ssh_client, log_name, local_store_dir):
:return:
"""

ssh_client = ssh_client_local_client.LocalClient(context=self.context, node={"ssh_type": "local"})
ssh_client = LocalClient(context=self.context, node={"ssh_type": "local"})
local_store_path = "{0}/{1}".format(local_store_dir, str(log_name).strip(".").replace("/", "_"))
if self.grep_args is not None:
grep_cmd = "grep -e '{grep_args}' {log_name} >> {local_store_path} ".format(grep_args=self.grep_args, log_name=log_name, local_store_path=local_store_path)
Expand All @@ -547,7 +547,7 @@ def __pharse_offline_log_file(self, ssh_client, log_name, local_store_dir):
download_file(ssh_client, log_name, local_store_path, self.stdio)

def __parse_memory_label(self, file_full_path):
ssh_client = ssh_client_local_client.LocalClient(context=self.context, node={"ssh_type": "local"})
ssh_client = LocalClient(context=self.context, node={"ssh_type": "local"})
if self.version >= '4.3':
grep_cmd = 'grep -n "memory_dump.*statistics" ' + file_full_path
elif self.version >= '4.0' and self.version < '4.3':
Expand Down
Loading