linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Todd Gill <tgill@redhat.com>
To: linux-lvm@redhat.com
Cc: tgill@redhat.com
Subject: [linux-lvm] [PATCH 0/2] JSON output for dmstats
Date: Fri, 24 Jan 2020 14:58:28 -0500	[thread overview]
Message-ID: <20200124195830.6720-1-tgill@redhat.com> (raw)

This set of patches adds "--reportformat basic|json" options for the
dmstats list and report commands.

In the case where --count is specified with the JSON reportformat, the
output will be <count> consecutive JSON documents.

Example output of a single iteration of "report" in JSON:

{
    "report": [{
        "stats_name": "mirrorvg-mirrorlv",
        "group_id": "-",
        "region_id": "0",
        "obj_type": "area",
        "area_id": "0",
        "area_start": "0",
        "area_len": "1.00g",
        "reads_merged_per_sec": "0.00",
        "writes_merged_per_sec": "0.00",
        "reads_per_sec": "0.00",
        "writes_per_sec": "0.00",
        "read_size_per_sec": "0",
        "write_size_per_sec": "0",
        "avg_request_size": "0",
        "queue_size": "0.00",
        "util": "0.00",
        "await": "0.00",
        "read_await": "0.00",
        "write_await": "0.00"
   }]
}

The above JSON has been reformatted for line length, but the content
is from dmstats using this change.

Example output of "list" in JSON:

{
    "list": [{
        "stats_name": "mirrorvg-mirrorlv",
        "group_id": "-",
        "region_id": "0",
        "obj_type": "region",
        "region_start": "0",
        "region_len": "1.00g",
        "area_count": "1",
        "area_len": "1.00g",
        "program_id": "dmstats"
    }]
}

Todd Gill (2):
  Add JSON output support to dmstats for list and report subcommands
  Update man page to include --reportformat for list and report
    subcommands

 libdm/dm-tools/dmsetup.c | 45 +++++++++++++++++++++++++++++++++-------
 man/dmstats.8_main       | 11 ++++++++++
 2 files changed, 48 insertions(+), 8 deletions(-)

-- 
2.21.1

             reply	other threads:[~2020-01-24 19:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24 19:58 Todd Gill [this message]
2020-01-24 19:58 ` [linux-lvm] [PATCH 1/2] Add JSON output support to dmstats for list and report subcommands Todd Gill
2020-01-24 19:58 ` [linux-lvm] [PATCH 2/2] Update man page to include --reportformat " Todd Gill

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=20200124195830.6720-1-tgill@redhat.com \
    --to=tgill@redhat.com \
    --cc=linux-lvm@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).