On Mon, Oct 17, 2022 at 07:41:02AM +0000, Chengwen Feng wrote:
> Currently, the dpdk-telemetry.py show json in raw format under
> interactive mode, 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=2
> parameter under interactive mode, 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,
> "rx_mbuf_allocation_errors": 0,
> "rx_q0_packets": 0,
> ...
> }
> }
>
> Note: the non-interactive mode is made machine-readable and remains the
> original way (it means don't use indent to pretty print).
>
> Signed-off-by: Chengwen Feng <fengcheng...@huawei.com>
> Acked-by: David Marchand <david.march...@redhat.com>
> Acked-by: Ciara Power <ciara.po...@intel.com>
>
Tested-by: Bruce Richardson <bruce.richard...@intel.com>