From: Tom Morris Date: Fri, 15 Mar 2019 04:03:59 +0000 (-0400) Subject: Fix Keep cache recommendation calculation. X-Git-Tag: 1.4.0~100^2~3 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/7f93b99e31c946a1a92dafcbcd1d0e36a710c32b Fix Keep cache recommendation calculation. Remove extra MB (2**20) factor. Refs #14451 Arvados-DCO-1.1-Signed-off-by: Tom Morris --- 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):