Convert to int to satisfy Python for unit tests

This commit is contained in:
Carsten Grohmann 2022-06-28 20:43:34 +02:00
parent 5174b0a23a
commit be9bda6536

View File

@ -1316,11 +1316,14 @@ class OOMAnalyser:
"system_total_ramswap_kb" "system_total_ramswap_kb"
] = self.oom_result.details["system_total_ram_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 # TODO: Current RSS calculation based on process table is probably incorrect,
# between processes and threads # because it don't differentiates between processes and threads
total_rss_pages = 0 total_rss_pages = 0
for pid in self.oom_result.details["_pstable"].keys(): 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"] = ( self.oom_result.details["system_total_ram_used_kb"] = (
total_rss_pages * self.oom_result.details["page_size_kb"] total_rss_pages * self.oom_result.details["page_size_kb"]
) )