A-Tune-Collector/Ubuntu-20.04.3-LTS.patch
gaoruoshu@huawei.com 0bb8fedb32 feature: enable application configs
(cherry picked from commit c9558b4276c94f7fc75fccf1d167f14b53ee1342)
2023-08-07 10:43:26 +08:00

40 lines
1.7 KiB
Diff

From 2fd1148dcec21a8a99fbb59240ba2e2abfe7c31c Mon Sep 17 00:00:00 2001
From: Masterwater-y <yin12162000@outlook.com>
Date: Fri, 28 Jan 2022 18:07:52 +0800
Subject: [PATCH 01/11] adapt Ubuntu 20.04.3 LTS
---
atune_collector/plugin/monitor/common.py | 2 +-
atune_collector/plugin/monitor/memory/topo.py | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/atune_collector/plugin/monitor/common.py b/atune_collector/plugin/monitor/common.py
index a646b32..12a07f2 100755
--- a/atune_collector/plugin/monitor/common.py
+++ b/atune_collector/plugin/monitor/common.py
@@ -230,7 +230,7 @@ class Monitor(object):
def walk_class_type(father, class_type, desc, datas):
"""get key field"""
if "class" in father and father["class"] == class_type:
- if "description" in father and (desc is None or father["description"] == desc):
+ if "description" in father and (desc is None or father["description"].lower() == desc.lower()):
datas.append(father)
return
if "children" in father:
diff --git a/atune_collector/plugin/monitor/memory/topo.py b/atune_collector/plugin/monitor/memory/topo.py
index 7e828f3..2c0c39e 100755
--- a/atune_collector/plugin/monitor/memory/topo.py
+++ b/atune_collector/plugin/monitor/memory/topo.py
@@ -95,6 +95,8 @@ class MemTopo(Monitor):
cmd=self.__cmd).split(), stderr=no_print)
info = o_json.decode()
json_content = json.loads(info)
+ if (isinstance(json_content, list)):
+ json_content = {'children': json_content}
dict_datas = get_class_type(json_content, "memory", "System Memory")
if fmt == "json":
--
2.27.0