[PATCH v2] usertools: telemetry json support pretty print
Power, Ciara
ciara.power at intel.com
Fri Oct 14 14:44:33 CEST 2022
Hi Chengwen,
> -----Original Message-----
> From: David Marchand <david.marchand at redhat.com>
> Sent: Friday 14 October 2022 10:50
> To: Chengwen Feng <fengchengwen at huawei.com>
> Cc: thomas at monjalon.net; dev at dpdk.org; Power, Ciara
> <ciara.power at intel.com>
> Subject: Re: [PATCH v2] usertools: telemetry json support pretty print
>
> On Fri, Oct 14, 2022 at 5:31 AM Chengwen Feng <fengchengwen at huawei.com>
> wrote:
> >
> > Currently, the dpdk-telemetry.py show json in raw format, which is not
> > good for human reading.
> >
> > E.g. The command '/ethdev/xstats,0' will output:
> > {"/ethdev/xstats": {"rx_good_packets": 0, "tx_good_packets": 0,
> > "rx_good_bytes": 0, "tx_good_bytes": 0, "rx_missed_errors": 0,
> > "rx_errors": 0, "tx_errors": 0, "rx_mbuf_allocation_errors": 0,
> > "rx_q0_packets": 0,...}}
> >
> > This patch supports json pretty print by adding extra indent=4
> > parameter, so the same command will output:
> > {
> > "/ethdev/xstats": {
> > "rx_good_packets": 0,
> > "tx_good_packets": 0,
> > "rx_good_bytes": 0,
> > "tx_good_bytes": 0,
> > "rx_missed_errors": 0,
> > "rx_errors": 0,
> > "tx_errors": 0,
> > "rx_mbuf_allocation_errors": 0,
> > "rx_q0_packets": 0,
> > ...
> > }
> > }
> >
> > Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
>
> It's indeed easier to read, but maybe 4 chars is too much.
> 2 chars seem enough to me.
[CP]
+1 on using 2 chars
>
> In any case I like the idea:
> Acked-by: David Marchand <david.marchand at redhat.com>
Acked-by: Ciara Power <ciara.power at intel.com>
More information about the dev
mailing list