diff --git a/src/con_duct/__main__.py b/src/con_duct/__main__.py index 89674e2a..6718e695 100644 --- a/src/con_duct/__main__.py +++ b/src/con_duct/__main__.py @@ -130,7 +130,13 @@ class ProcessStats: cmd: str def max(self, other: ProcessStats) -> ProcessStats: - assert self.cmd == other.cmd + if self.cmd != other.cmd: + lgr.critical("TEST!\n!!!!!!!!!\n!!!!!!!!\n!!!!!!!!!!\n!!!!!!!!!!!") + lgr.critical(f"self cmd:{self.cmd}") + lgr.critical(f"other cmd:{other.cmd}") + lgr.critical(f"self whole:{asdict(self)}") + lgr.critical(f"other whole:{asdict(other)}") + raise Exception() return ProcessStats( pcpu=max(self.pcpu, other.pcpu), pmem=max(self.pmem, other.pmem), @@ -268,7 +274,11 @@ def max(self: Sample, other: Sample) -> Sample: for pid in self.stats.keys() | other.stats.keys(): if (mine := self.stats.get(pid)) is not None: if (theirs := other.stats.get(pid)) is not None: - output.add_pid(pid, mine.max(theirs)) + try: + output.add_pid(pid, mine.max(theirs)) + except Exception as e: + lgr.critical(f"Pid: {pid} Mine: {mine} theirs: {theirs}") + raise e else: output.add_pid(pid, mine) else: