Skip to content

Commit

Permalink
Merge pull request #139 from psyinfra/add-unhandled-events
Browse files Browse the repository at this point in the history
Add unhandled events
  • Loading branch information
mathisloevenich authored Nov 18, 2021
2 parents 8244001 + e034c16 commit abbb232
Show file tree
Hide file tree
Showing 4 changed files with 545 additions and 149 deletions.
9 changes: 6 additions & 3 deletions htcanalyze/log_analyzer/condor_log/ram_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def plot_ram(self, show_legend=False) -> str:
:param show_legend: Shows a legend
:return: str
"""
ram = [ram.size_update for ram in self.image_size_events]
ram = [
ram.size_update/1000 # convert to MB
for ram in self.image_size_events
]
dates = [ram.time_stamp for ram in self.image_size_events]
if len(ram) == 0:
return "" # No memory usage detected
Expand All @@ -44,7 +47,7 @@ def plot_ram(self, show_legend=False) -> str:
return str(
f"Single memory update found:\n"
f"Memory usage on the {dates[0]} "
f"was updatet to {ram[0]} MB\n"
f"was updated to {ram[0]} MB\n"
)

# else
Expand All @@ -54,7 +57,7 @@ def plot_ram(self, show_legend=False) -> str:
fig.set_x_limits(min_=min(dates))
min_ram = int(min(ram)) # raises error if not casted
fig.set_y_limits(min_=min_ram)
fig.y_label = "Usage (KB)"
fig.y_label = "Usage [MB]"
fig.x_label = "Time"

# this will use the self written function _
Expand Down
Loading

0 comments on commit abbb232

Please sign in to comment.