From 3cea4bad5f29ed94f1ebc19e03b85553f24901b4 Mon Sep 17 00:00:00 2001 From: fly Date: Mon, 8 Mar 2021 22:26:48 +0100 Subject: [PATCH] Ported to python3 Signed-off-by: fly --- analyse-run-time.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/analyse-run-time.py b/analyse-run-time.py index fa3e6f0..5bcafb0 100755 --- a/analyse-run-time.py +++ b/analyse-run-time.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#! /usr/bin/python3 # Copyright (C) 2018-2020 Merspieler, merspieler _at_ airmail.cc # # This program is free software; you can redistribute it and/or @@ -82,12 +82,12 @@ if read_src: try: with open(ifile) as f: for line in f: - match = re.findall("SpawnPoolWorker-\d+ root INFO +Time used in seconds for (.*): (\d+\.\d+)", line) + match = re.findall("Time used in seconds for (.*): (\d+\.\d+)", line) + if match != []: + times.append(match[0]) + match = re.findall("(Reading OSM .* data for \['.*'\]) from db took (\d+\.\d+) seconds.", line) if match != []: times.append(match[0]) - match = re.findall("SpawnPoolWorker-\d+ root INFO +(Reading OSM .* data for \['.*'\]) from db took (\d+\.\d+) seconds.", line) - if match != []: - times.append(match[0]) except: print("err") sys.exit(1) @@ -124,4 +124,4 @@ i = len(sortkey) - 1 while i >= 0: tasks.sort(key=lambda tasks: tasks[sortkey[i]], reverse=True) i -= 1 -print tabulate(tasks,headers="keys",floatfmt=".2f") +print (tabulate(tasks,headers="keys",floatfmt=".2f"))