Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 18, 2024
1 parent b2bb66e commit 0aa3975
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions alto/commands/parse_monitoring_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from pathlib import Path

import fsspec
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.pyplot as plt
from dateutil.parser import parse

from alto.utils.io_utils import _get_scheme
Expand Down Expand Up @@ -98,7 +98,7 @@ def get_task_and_shard(log_path):
shard_name = ""

if task_name.startswith("call-"):
task_name = task_name[len("call-"):]
task_name = task_name[len("call-") :]
# gs://output/cromwell_execution/xxx_workflow/92f48dc5-6/call-xxx_task/shard-0/monitoring.log
# gs://output/cromwell_execution/xxx_workflow/92f48dc5-6/call-xxx_task/shard-0/cacheCopy/monitoring.log
return task_name, shard_name
Expand Down Expand Up @@ -127,28 +127,28 @@ def parse_log(path, details=True) -> dict:
# e.g. [Tue Jan 24 17:34:29 UTC 2023]
times.append(parse(line[1:-1]))
if line.startswith("* CPU usage:"):
value = float(line[line.index(":") + 1: len(line) - 1])
value = float(line[line.index(":") + 1 : len(line) - 1])
if details:
cpu_values.append(value)
max_cpu_percent = max(max_cpu_percent, value)
elif line.startswith("* Memory usage:"):
value = float(line[line.index(":") + 1: len(line) - 1])
value = float(line[line.index(":") + 1 : len(line) - 1])
if details:
memory_values.append(value)
max_memory_percent = max(max_memory_percent, value)
elif line.startswith("* Disk usage:"):
value = line[line.index(":") + 1: len(line) - 1]
value = line[line.index(":") + 1 : len(line) - 1]
if value != "":
value = float(value)
if details:
disk_values.append(value)
max_disk_percent = max(max_disk_percent, value)
elif line.startswith("#CPU"):
cpus = int(line[line.index(":") + 1: len(line)])
cpus = int(line[line.index(":") + 1 : len(line)])
elif line.startswith("Total Memory:"):
total_memory = float(line[line.index(":") + 1: len(line) - 1])
total_memory = float(line[line.index(":") + 1 : len(line) - 1])
elif line.startswith("Total Disk space:"):
value = line[line.index(":") + 1: len(line) - 1]
value = line[line.index(":") + 1 : len(line) - 1]
if value != "":
total_disk = float(value)
if len(times) >= 2:
Expand Down

0 comments on commit 0aa3975

Please sign in to comment.