Skip to content

Commit de2e553

Browse files
committed
fix: progress no longer depends on tj
1 parent df2cb87 commit de2e553

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ptop.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ def parse(input_line: str) -> dict:
3838
return parsed
3939

4040

41-
def progress(lines, total_jops):
42-
return (len(lines) / tj) * 100 if tj else 0
41+
def progress(lines, total_jobs):
42+
return (len(lines) / total_jobs) * 100 if total_jobs else 0
4343

4444

4545
def ascii_progress_bar(percentage, bar_length=50):
@@ -71,6 +71,7 @@ def ascii_progress_bar(percentage, bar_length=50):
7171
"--------------------------------------------------------------"
7272
)
7373

74+
7475
for line in new_lines:
7576
parsed_line = parse(line.replace("\x00", ""))
7677
host = parsed_line["host"]
@@ -96,10 +97,12 @@ def ascii_progress_bar(percentage, bar_length=50):
9697
failed_overall = 0
9798

9899
for host, stats in hosts.items():
100+
99101
throughput = len(stats["jobs"]) / (
100102
time.mktime(time.gmtime())
101103
- time.mktime(stats["jobs"][0]["starttime"])
102104
)
105+
103106
throughput_overall += throughput
104107
totel_overall += stats["total"]
105108
succsessful_overall += stats["successful"]

0 commit comments

Comments
 (0)