Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

req: add percentage complete #300

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
__pycache__
venv
src/plotman.egg-info
11 changes: 9 additions & 2 deletions src/plotman/reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def status_report(jobs, width, height=None, tmp_prefix='', dst_prefix=''):

tab = tt.Texttable()
headings = ['plot id', 'k', 'tmp', 'dst', 'wall', 'phase', 'tmp',
'pid', 'stat', 'mem', 'user', 'sys', 'io']
'pid', 'stat', 'pct', 'mem', 'user', 'sys', 'io']
if height:
headings.insert(0, '#')
tab.header(headings)
Expand All @@ -91,10 +91,16 @@ def status_report(jobs, width, height=None, tmp_prefix='', dst_prefix=''):
# Omitted row
elif abbreviate_jobs_list and i > n_begin_rows and i < (len(jobs) - n_end_rows):
continue

# Regular row
else:
try:
# Get percent complete
finished_log_lines = 2626
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does 2626 comes from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a look at the issue linked above for all the details, but that is the number of sequential log lines in a 128 plot (pulled from chia-gui sec)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Defining as a constant would be interesting just like Chia has FINISHED_LOG_LINES. I looked at the thread and compared to my own files, and they resulted in 2630 in almost all cases. Maybe 2626 is a "safer" value? 🤔

current_log_lines = len(open(j.logfile).readlines())
progress = '100%'
if current_log_lines < finished_log_lines:
progress = "{:.0%}".format(current_log_lines / finished_log_lines)
# Create row
row = [j.plot_id[:8],
j.k,
abbr_path(j.tmpdir, tmp_prefix),
Expand All @@ -104,6 +110,7 @@ def status_report(jobs, width, height=None, tmp_prefix='', dst_prefix=''):
plot_util.human_format(j.get_tmp_usage(), 0),
j.proc.pid,
j.get_run_status(),
progress,
plot_util.human_format(j.get_mem_usage(), 1),
plot_util.time_format(j.get_time_user()),
plot_util.time_format(j.get_time_sys()),
Expand Down