All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Sidong Yang <realwakka@gmail.com>
Cc: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 2/2] btrfs-progs: device stats: add json output format
Date: Thu, 10 Dec 2020 21:53:09 +0100	[thread overview]
Message-ID: <20201210205308.GJ6430@twin.jikos.cz> (raw)
In-Reply-To: <20201111163909.3968-2-realwakka@gmail.com>

On Wed, Nov 11, 2020 at 04:39:09PM +0000, Sidong Yang wrote:
> Add supports for json formatting, this patch changes hard coded printing
> code to formatted print with output formatter. Json output would be
> useful for other programs that parse output of the command. but it
> changes the text format.
> 
> Example text format:
> 
> device:                 /dev/vdb
> devid			1
> write_io_errs:          0
> read_io_errs:           0
> flush_io_errs:          0
> corruption_errs:        0
> generation_errs:        0
> 
> Example json format:
> 
> {
>   "__header": {
>     "version": "1"
>   },
>   "device-stats": [
>     {
>       "device": "/dev/vdb",
>       "devid": "1",
>       "write_io_errs": "0",
>       "read_io_errs": "0",
>       "flush_io_errs": "0",
>       "corruption_errs": "0",
>       "generation_errs": "0"
>     }
>   ],
> }

This looks good, regarding the stats this should be sufficient. We could
add some more filesystem information, but as it would be probably
another hash key.

  reply	other threads:[~2020-12-10 20:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11 16:39 [PATCH v2 1/2] btrfs-progs: common: introduce fmt_print_start_object Sidong Yang
2020-11-11 16:39 ` [PATCH v2 2/2] btrfs-progs: device stats: add json output format Sidong Yang
2020-12-10 20:53   ` David Sterba [this message]
2021-02-16 10:21   ` Filipe Manana
2020-12-10 20:28 ` [PATCH v2 1/2] btrfs-progs: common: introduce fmt_print_start_object David Sterba
2020-12-11 16:11   ` Sidong Yang

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=20201210205308.GJ6430@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=realwakka@gmail.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.