From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EB6EEA00C2; Fri, 14 Oct 2022 11:50:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D1A7A42D22; Fri, 14 Oct 2022 11:50:36 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 52EA542CF8 for ; Fri, 14 Oct 2022 11:50:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665741034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eFLf9G29q/3Wn7JpFpRYXVdkGSzR/RUFYeRrPK8YnsI=; b=eQTJn2Mg1+oLxLNfvX27oh2SR7q277hAUCmuPnSA+E9gFurNJfFUTGEUp/5BmwegfvUERJ pOpUMs4nppPI9yvWAVF547zA1gP/GUzzGuKi2GQthCkqRxHyBlcFw3zRCUlCh9ePwrwrR7 e/v1eOa7gwhWF9uquITwmpEbUeuo9rE= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-581-R1MZNMgSOgi-NAD74sYdmw-1; Fri, 14 Oct 2022 05:50:33 -0400 X-MC-Unique: R1MZNMgSOgi-NAD74sYdmw-1 Received: by mail-pj1-f70.google.com with SMTP id z24-20020a17090abd9800b0020d43dcc8c3so4947021pjr.9 for ; Fri, 14 Oct 2022 02:50:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eFLf9G29q/3Wn7JpFpRYXVdkGSzR/RUFYeRrPK8YnsI=; b=YZwdS5kHqMLlCehR9bBdKPd/jCgdQSOYuWJRxwJW2z80PkotNQ9bLV+sYiC2bCxgYo aocn5zlC2kkhQcHLNywJLuyj8Olo0xbKpPUUBrRa3snwq1jFukbh0STgqitx86BWuuta hjcct3hBydXrOfFzn7PpBzD9kcUVUTVd5Rjjo904e/GTIp037Uj/MRwXXCMoUNyJ7CSM slfsWIWHXGkzkyRRPuTvIBiJp/xJvdrEaAwDmXt7fezXZPjh7KaaCU9+3ckOTHAFU7J5 TUqTzHu8MOh9Mw3hQMdeG6RB++NpNeKL8JbQxwGU6I7b/4/nVjT1xhI3OVTmJi6XrsbS JEnQ== X-Gm-Message-State: ACrzQf0sjZSJsX0z+Pvw6OKOkg1ZwR3+cyJ9RPPkdzDcAYe9XyXiJd0a 13OjvtV+IExFicr09h5200SOQzwDe7hrMiGWcWAn/TUKLxWI+2h4E8mKsmBWj4rtt5CG5aRhzPZ sbRpaNj6CcX7je4DuZ34= X-Received: by 2002:a05:6a00:1f10:b0:562:b9e1:55e9 with SMTP id be16-20020a056a001f1000b00562b9e155e9mr4503562pfb.60.1665741032748; Fri, 14 Oct 2022 02:50:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6uB3b2PoGqH+Ov46xxnW7O3h3/aR0jwUNTVjHwm8Kba/E9+BUrs3keEouwgAfvVijknJyS0+JRRtAusbWCdBs= X-Received: by 2002:a05:6a00:1f10:b0:562:b9e1:55e9 with SMTP id be16-20020a056a001f1000b00562b9e155e9mr4503534pfb.60.1665741032283; Fri, 14 Oct 2022 02:50:32 -0700 (PDT) MIME-Version: 1.0 References: <20221014023338.51464-1-fengchengwen@huawei.com> <20221014032504.32534-1-fengchengwen@huawei.com> In-Reply-To: <20221014032504.32534-1-fengchengwen@huawei.com> From: David Marchand Date: Fri, 14 Oct 2022 11:50:20 +0200 Message-ID: Subject: Re: [PATCH v2] usertools: telemetry json support pretty print To: Chengwen Feng Cc: thomas@monjalon.net, dev@dpdk.org, ciara.power@intel.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Fri, Oct 14, 2022 at 5:31 AM Chengwen Feng 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 It's indeed easier to read, but maybe 4 chars is too much. 2 chars seem enough to me. In any case I like the idea: Acked-by: David Marchand -- David Marchand