From be9bda6536c092c2fd8589ae73fb8d787a26ce93 Mon Sep 17 00:00:00 2001 From: Carsten Grohmann Date: Tue, 28 Jun 2022 20:43:34 +0200 Subject: [PATCH] Convert to int to satisfy Python for unit tests --- OOMAnalyser.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/OOMAnalyser.py b/OOMAnalyser.py index 5230875..f980242 100644 --- a/OOMAnalyser.py +++ b/OOMAnalyser.py @@ -1316,11 +1316,14 @@ class OOMAnalyser: "system_total_ramswap_kb" ] = self.oom_result.details["system_total_ram_kb"] - # TODO: Used RSS calculation based on process table is probably incorrect, because it don't differentiates - # between processes and threads + # TODO: Current RSS calculation based on process table is probably incorrect, + # because it don't differentiates between processes and threads total_rss_pages = 0 for pid in self.oom_result.details["_pstable"].keys(): - total_rss_pages += self.oom_result.details["_pstable"][pid]["rss_pages"] + # convert to int to satisfy Python for unit tests + total_rss_pages += int( + self.oom_result.details["_pstable"][pid]["rss_pages"] + ) self.oom_result.details["system_total_ram_used_kb"] = ( total_rss_pages * self.oom_result.details["page_size_kb"] )