Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
Apfelholz committed Nov 8, 2024
1 parent de2e553 commit 0023ce1
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions ptop.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@ def ascii_progress_bar(percentage, bar_length=50):

clear_console()
print(ascii_progress_bar(progress(lines, tj)))
print(
"--------------------------------------------------------------"
)
print(
"Host Throughput (jobs/s) Total Successful Failed"
)
print(
"--------------------------------------------------------------"
)

print("--------------------------------------------------------------")
print("Host Throughput (jobs/s) Total Successful Failed")
print("--------------------------------------------------------------")

for line in new_lines:
parsed_line = parse(line.replace("\x00", ""))
Expand All @@ -97,12 +90,10 @@ def ascii_progress_bar(percentage, bar_length=50):
failed_overall = 0

for host, stats in hosts.items():

throughput = len(stats["jobs"]) / (
time.mktime(time.gmtime())
- time.mktime(stats["jobs"][0]["starttime"])
)

throughput_overall += throughput
totel_overall += stats["total"]
succsessful_overall += stats["successful"]
Expand All @@ -112,9 +103,7 @@ def ascii_progress_bar(percentage, bar_length=50):
f"{host:12} {throughput:.2f} {stats['total']:5} {stats['successful']:5} {stats['failed']:5}"
)

print(
"--------------------------------------------------------------"
)
print("--------------------------------------------------------------")
print(
f"{'overall':12} {throughput_overall:.2f} {totel_overall:5} {succsessful_overall:5} {failed_overall:5}"
)
Expand Down

0 comments on commit 0023ce1

Please sign in to comment.