loadtask:add "summary" in post script

Signed-off-by: Hang Zhao <zhao.hang@linux.alibaba.com>
This commit is contained in:
Hang Zhao 2024-02-20 11:31:41 +08:00
parent 186e24c965
commit 716ad0e046
1 changed files with 15 additions and 1 deletions

View File

@ -149,27 +149,41 @@ def parse_log(file):
hardirq_summary = "NULL" hardirq_summary = "NULL"
softirq_summary = "NULL" softirq_summary = "NULL"
io_summary = "NULL" io_summary = "NULL"
new_parse_data["summary"] = {}
new_parse_data["summary"]["suggestion"] = "N/A"
if reason["sys"] == "false": if reason["sys"] == "false":
sys_summary = " is normal;" sys_summary = " is normal;"
else: else:
sys_summary = " is abnormal;" sys_summary = " is abnormal;"
new_parse_data["summary"]["suggestion"] = "sys utils is high,use nosched tool to deep diagnosis;"
if reason["irq"] == "false": if reason["irq"] == "false":
hardirq_summary = " is normal;" hardirq_summary = " is normal;"
else: else:
hardirq_summary = " is abnormal;" hardirq_summary = " is abnormal;"
new_parse_data["summary"]["suggestion"] = "irq utils is high,use irqoff tool to deep diagnosis;"
if reason["softirq"] == "false": if reason["softirq"] == "false":
softirq_summary = " is normal;" softirq_summary = " is normal;"
else: else:
softirq_summary = " is abnormal;" softirq_summary = " is abnormal;"
new_parse_data["summary"]["suggestion"] = "softirq utils is high,use softirq tool to deep diagnosis;"
if reason["io"] == "false": if reason["io"] == "false":
io_summary = " is normal;" io_summary = " is normal;"
else: else:
io_summary = " is abnormal;" io_summary = " is abnormal;"
new_parse_data["summary"]["suggestion"] = "io utils is high,use iosdiag tool to deep diagnosis;"
new_parse_data["summary"] = "Load Influences Result:"+"sys utils" + sys_summary + \ if int(float(count["uninterrupt tasks"])) >= 5:
new_parse_data["summary"]["suggestion"] = "D task counts is more than 5,please analyse calltrace of tasks by D task pie chart"
if reason["sys"] == "false" and reason["irq"] == "false" and reason["softirq"] == "false" and reason["io"] == "false"
new_parse_data["summary"]["status"] = "normal"
else
new_parse_data["summary"]["status"] = "warning"
new_parse_data["summary"]["cause"] = "Load Influences Result:"+"sys utils" + sys_summary + \
"hardirq" + hardirq_summary + "softirq" + softirq_summary + "io" + io_summary "hardirq" + hardirq_summary + "softirq" + softirq_summary + "io" + io_summary
new_parse_data["datataskcount"] = {"data": []} new_parse_data["datataskcount"] = {"data": []}
if "uninterrupt tasks" in count.keys() and "runnig tasks" in count.keys(): if "uninterrupt tasks" in count.keys() and "runnig tasks" in count.keys():