From 1f0880c12d0f3e91b82ffe02ca1cc899ed7295da Mon Sep 17 00:00:00 2001 From: Jeremy Auguste <jeremy.auguste@lis-lab.fr> Date: Wed, 31 Jul 2019 16:18:03 +0200 Subject: [PATCH] Non satisfactory fix for when a besteffort job is killed and replaced --- oarstats.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/oarstats.py b/oarstats.py index bc19599..0f973aa 100755 --- a/oarstats.py +++ b/oarstats.py @@ -99,7 +99,7 @@ def main(): owners = {} resources_pattern = re.compile('R=([0-9]+)') - walltime_pattern = re.compile('W=([0-9]+:[0-9]+:[0-9]+)') + walltime_pattern = re.compile('W=([0-9]+(:[0-9]+(:[0-9]+)?)?)') queue_pattern = re.compile('Q=(\S+)') karma_pattern = re.compile('Karma=([0-9]+\.[0-9]+)') gpu_pattern = re.compile('gpu is not null', flags=re.IGNORECASE) @@ -107,6 +107,8 @@ def main(): if job_info["owner"] not in owners: owners[job_info["owner"]] = Owner(job_info["owner"]) elapsed_time = 0 if job_info["startTime"] == 0 else time.time() - job_info["startTime"] + if job_info["message"] == '': + continue tokens = re.search(walltime_pattern, job_info["message"]).group(1).split(':') wall_time = int(tokens[0]) * 3600 + int(tokens[1]) * 60 + int(tokens[2]) resources = int(re.search(resources_pattern, job_info["message"]).group(1)) -- GitLab