From 4fab6f67a6fa516939df923ec7e11fe23b33a8f0 Mon Sep 17 00:00:00 2001 From: Lyronn Levy <90407928+Fisstouk@users.noreply.github.com> Date: Thu, 20 Jul 2023 17:35:21 +0200 Subject: [PATCH] Update key in dictionary --- linux/diagnostic/high_cpu_parser.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/linux/diagnostic/high_cpu_parser.py b/linux/diagnostic/high_cpu_parser.py index 7a8a039..82312de 100755 --- a/linux/diagnostic/high_cpu_parser.py +++ b/linux/diagnostic/high_cpu_parser.py @@ -21,7 +21,7 @@ if "path" in v: path = v["path"] - cnt = int(v["total_files_scanned"]) + cnt = int(v["totalFilesScanned"]) if name not in groups: groups[name] = [cnt, path] else: @@ -32,7 +32,7 @@ print("%s\t%d" % (k, groups[k][0])) else: - lines = sorted(vals, key=lambda k: int(k['total_files_scanned']), reverse=True) + lines = sorted(vals, key=lambda k: int(k['totalFilesScanned']), reverse=True) for v in lines[:top]: - if int(v["total_files_scanned"]) != 0: - print("%s\t%s\t%s\t%s" % (v["id"], v["name"], v["total_files_scanned"], v["path"])) + if int(v["totalFilesScanned"]) != 0: + print("%s\t%s\t%s\t%s" % (v["id"], v["name"], v["totalFilesScanned"], v["path"]))