Bug 225993

Summary: [PATCH] mfiutil: show progress command could be more user-friendly/consistent
Product: Base System Reporter: Enji Cooper <ngie>
Component: binAssignee: Allan Jude <allanjude>
Status: Closed FIXED    
Severity: Affects Some People CC: allanjude, eadler, jhb
Priority: --- Keywords: patch
Version: 11.1-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Improved "show progress" patch
none
Proposed change, restoring " finished in " text none

Description Enji Cooper freebsd_committer freebsd_triage 2018-02-17 21:18:43 UTC
Created attachment 190740 [details]
Improved "show progress" patch

I had to recently build a mfi volume member after a drive died, and I had to noticed that the output from "mfiutil show progress" was inconsistent on my 11.1-RELEASE machine.

The attached patch improves the time output to match the second (completion) time format, resulting in a more consistent, user-friendly experience.

Sidenotes: the attached patch sorts the #includes as well because it didn't conform to style(9).

Example output after the patch:

$ sudo mfiutil show progress
drive  4 Rebuild: 83.34% complete after 13:11:13. Completion ETA: 2:38:12
Comment 1 John Baldwin freebsd_committer freebsd_triage 2018-02-27 20:21:22 UTC
Looks good in general.  I would keep the "finished in" text though.  ETA implies a walltime of when it would be complete ("Estimated Time of Arrival") rather than a count of remaining time.  You'd have to add the computed delta to the current time to get an ETA.
Comment 2 Enji Cooper freebsd_committer freebsd_triage 2018-04-02 07:20:50 UTC
Created attachment 192091 [details]
Proposed change, restoring " finished in " text
Comment 3 Enji Cooper freebsd_committer freebsd_triage 2018-10-13 01:52:17 UTC
John: I submitted a pull request for this item, incorporating your suggested changes: https://github.com/freebsd/freebsd/pull/171
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-10-13 02:22:02 UTC
A commit references this bug:

Author: allanjude
Date: Sat Oct 13 02:21:24 UTC 2018
New revision: 339344
URL: https://svnweb.freebsd.org/changeset/base/339344

Log:
  Make `mfiutil show progress` print out the elapsed time estimate in a
  more humanized way

  PR:		225993
  Submitted by:	Enji Cooper <yaneurabeya@gmail.com>
  Reviewed by:	jhb (previous version)
  Approved by:	re (rgrimes)

Changes:
  head/usr.sbin/mfiutil/mfi_cmd.c
Comment 5 Allan Jude freebsd_committer freebsd_triage 2018-10-13 02:23:11 UTC
Thank you for the patch.

Quality-of-life fixes like this make a big difference.