All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Linda Knippers <linda.knippers@hpe.com>
Cc: Yasunori Goto <y-goto@jp.fujitsu.com>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: [ndctl PATCH v2] ndctl, daxctl, list: add --human option for number formatting
Date: Mon, 10 Jul 2017 12:56:01 -0700	[thread overview]
Message-ID: <CAPcyv4jgNf44fRkSrf1O1LZTaB599fTeXv6SJGHnWQyvOS_r=w@mail.gmail.com> (raw)
In-Reply-To: <CAPcyv4g7SSML7=KtUWWAnL0ds1E+36hMhUBuk98-N3p8cGDQCQ@mail.gmail.com>

On Mon, Jul 10, 2017 at 12:47 PM, Dan Williams <dan.j.williams@intel.com> wrote:
> On Mon, Jul 10, 2017 at 11:42 AM, Linda Knippers <linda.knippers@hpe.com> wrote:
>> On 07/10/2017 02:26 PM, Dan Williams wrote:
>>> The json output format of the 'list' commands is meant to make it easy
>>> to ingest the data into other tools. However, for direct administrator
>>> use of the utility provide an option to format some numbers for easier
>>> human consumption, similar to the "-h" to du(1). Note that the short
>>> option is "-u" since "-h" is already established as the short option for
>>> "--help".
>>>
>>>     Before:
>>>     # ndctl list --region=7
>>>     {
>>>       "dev":"region7",
>>>       "size":67108864,
>>>       "available_size":67108864,
>>>       "type":"pmem",
>>>       "iset_id":-6382611090938810793,
>>>       "badblock_count":8
>>>     }
>>>
>>>     After:
>>>     # ndctl list --region=7 --human
>>>     {
>>>       "dev":"region7",
>>>       "size":"64.00 MiB / 67.11 MB",
>>>       "available_size":"64.00 MiB / 67.11 MB",
>>>       "type":"pmem",
>>>       "iset_id":"0xa76c6907811fae57",
>>>       "badblock_count":8
>>>     }
>>>
>>> Cc: Dave Jiang <dave.jiang@intel.com>
>>> Reported-by: Linda Knippers <linda.knippers@hpe.com>
>>> Reported-by: Yasunori Goto <y-goto@jp.fujitsu.com>
>>> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
>>> ---
>>>
>>> Changes since v1:
>>> * drop the auto-detect and just require the "--human" option for the
>>>   different format of the output. This prevents any confusion with
>>>   default output behavior (Yasunori)
>>>
>>> * include the JEDEC size in addition to the IEC size (i.e. MiB vs MB
>>>   etc) (Dave).
>>
>> I'd rather see us pick one or the other and not provide two values.
>> Even though this is the human friendly output, it's possible that it could
>> be used by other programs that know what MB means and know what MiB means
>> but now would need to know that / doesn't mean to divide one by the other.
>> I think as long as the units are clear, either one is ok.
>
> I started there, the thing that tipped it for me is that fio is
> currently outputting both formats when it displays size data. A script
> or another program should not be using the "--human" option, that
> should eliminate the opportunity for confusion.

How about this to get rid of the "/" character and more closely match fio?

{
  "dev":"region7",
  "size":"64.00 MiB (67.11 MB)",
  "available_size":"64.00 MiB (67.11 MB)",
  "type":"pmem",
  "iset_id":"0xa76c6907811fae57",
  "badblock_count":8
}
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  reply	other threads:[~2017-07-10 19:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-07 20:37 [ndctl PATCH 0/2] Be kind to humans Dan Williams
2017-07-07 20:37 ` [ndctl PATCH 1/2] ndctl, list: convert json control flags to bit-flags Dan Williams
2017-07-07 20:37 ` [ndctl PATCH 2/2] ndctl, daxctl, list: make terminal output human readable by default Dan Williams
2017-07-10  6:56   ` Yasunori Goto
2017-07-10 18:26     ` [ndctl PATCH v2] ndctl, daxctl, list: add --human option for number formatting Dan Williams
2017-07-10 18:42       ` Linda Knippers
2017-07-10 19:47         ` Dan Williams
2017-07-10 19:56           ` Dan Williams [this message]
2017-07-10 20:11             ` Linda Knippers
2017-07-10 20:14               ` [ndctl PATCH v3] " Dan Williams
2017-07-11  5:06                 ` Yasunori Goto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPcyv4jgNf44fRkSrf1O1LZTaB599fTeXv6SJGHnWQyvOS_r=w@mail.gmail.com' \
    --to=dan.j.williams@intel.com \
    --cc=linda.knippers@hpe.com \
    --cc=linux-nvdimm@lists.01.org \
    --cc=y-goto@jp.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.