From 7f93b99e31c946a1a92dafcbcd1d0e36a710c32b Mon Sep 17 00:00:00 2001 From: Tom Morris Date: Fri, 15 Mar 2019 00:03:59 -0400 Subject: [PATCH] Fix Keep cache recommendation calculation. Remove extra MB (2**20) factor. Refs #14451 Arvados-DCO-1.1-Signed-off-by: Tom Morris --- tools/crunchstat-summary/crunchstat_summary/summarizer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/crunchstat-summary/crunchstat_summary/summarizer.py b/tools/crunchstat-summary/crunchstat_summary/summarizer.py index 28afc9e0d5..51f7e43e07 100644 --- a/tools/crunchstat-summary/crunchstat_summary/summarizer.py +++ b/tools/crunchstat-summary/crunchstat_summary/summarizer.py @@ -409,7 +409,8 @@ class Summarizer(object): return utilization = (float(self.job_tot['blkio:0:0']['read']) / float(self.job_tot['net:keep0']['rx'])) - asked_cache = self.existing_constraints.get(constraint_key, 256) + # FIXME: the default on this get won't work correctly + asked_cache = self.existing_constraints.get(constraint_key, 256) * self._runtime_constraint_mem_unit() if utilization < 0.8: yield ( @@ -419,7 +420,7 @@ class Summarizer(object): self.label, utilization * 100.0, constraint_key, - asked_cache*2*(MB)/self._runtime_constraint_mem_unit()) + math.ceil(asked_cache * 2 / self._runtime_constraint_mem_unit())) def _format(self, val): -- 2.30.2