Fix test Python 3 integer divide difference.
authorTom Morris <tfmorris@veritasgenetics.com>
Wed, 13 Mar 2019 23:26:00 +0000 (19:26 -0400)
committerTom Morris <tfmorris@veritasgenetics.com>
Thu, 21 Mar 2019 19:35:36 +0000 (15:35 -0400)
Use float for both Python 2 & 3 like the rest of the metrics.
refs #14393

Arvados-DCO-1.1-Signed-off-by: Tom Morris <tfmorris@veritasgenetics.com>

tools/crunchstat-summary/crunchstat_summary/summarizer.py
tools/crunchstat-summary/tests/container_9tee4-dz642-lymtndkpy39eibk-arv-mount.txt.gz.report

index 543011ea2c743129fd25dfec8ed96f3c82c8a394..bcdc871a454ffbaab40a5cecebc5e0346c7b7f52 100644 (file)
@@ -290,7 +290,7 @@ class Summarizer(object):
                  self.stats_max['cpu']['user+sys__rate'],
                  lambda x: x * 100),
                 ('Overall CPU usage: {}%',
-                 self.job_tot['cpu']['user+sys'] /
+                 float(self.job_tot['cpu']['user+sys']) /
                  self.job_tot['time']['elapsed']
                  if self.job_tot['time']['elapsed'] > 0 else 0,
                  lambda x: x * 100),
@@ -344,7 +344,7 @@ class Summarizer(object):
                 'try runtime_constraints "{}":{}'
             ).format(
                 self.label,
-                int(math.ceil(cpu_max_rate*100)),
+                math.ceil(cpu_max_rate*100),
                 constraint_key,
                 int(used_cores))
 
index 98194619495816bfa4a612710ad1506dcbcab114..5148a4523af6c8a06cdc3568da5bc4272c1d1da1 100644 (file)
@@ -14,7 +14,7 @@ time  elapsed 10      -       10
 # Number of tasks: 1
 # Max CPU time spent by a single task: 0s
 # Max CPU usage in a single interval: 0%
-# Overall CPU usage: 0%
+# Overall CPU usage: 0.00%
 # Max memory used by a single task: 0.00GB
 # Max network traffic in a single task: 0.00GB
 # Max network speed in a single interval: 0.00MB/s