Skip to content

Commit

Permalink
Add some debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
asmacdo committed Sep 11, 2024
1 parent 9b83379 commit 0928ef8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/con_duct/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Check warning on line 139 in src/con_duct/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/con_duct/__main__.py#L134-L139

Added lines #L134 - L139 were not covered by tests
return ProcessStats(
pcpu=max(self.pcpu, other.pcpu),
pmem=max(self.pmem, other.pmem),
Expand Down Expand Up @@ -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

Check warning on line 281 in src/con_duct/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/con_duct/__main__.py#L279-L281

Added lines #L279 - L281 were not covered by tests
else:
output.add_pid(pid, mine)
else:
Expand Down

0 comments on commit 0928ef8

Please sign in to comment.