DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Ciara Power <ciara.power@intel.com>
Cc: kevin.laatz@intel.com, dev@dpdk.org, bruce.richardson@intel.com
Subject: Re: [dpdk-dev] [PATCH v3] doc: add more detail to telemetry guides
Date: Thu, 30 Jul 2020 20:28:59 +0200	[thread overview]
Message-ID: <3728578.6CtKLKD1J2@thomas> (raw)
In-Reply-To: <20200724112033.24860-1-ciara.power@intel.com>

24/07/2020 13:20, Ciara Power:
> +**Example Callback**
> +
> +This callback is an example of handling multiple commands in one callback,
> +and also shows the use of params which holds a port ID. The params input needs
> +to be validated and converted to the required integer type for port ID. The cmd
> +parameter is then used in a comparison to decide which command was requested,
> +which will decide what port information should fill the rte_tel_data structure.

Some variable names above needs to be enclosed in ``.

[...]
> +Array Data
> +^^^^^^^^^^
> +
> +  Some data will need to be formatted in a list structure. For example, if a
> +  callback needs to return five integer values in the data response, it can be
> +  constructed using the following functions to build up the list:
> +
> +  .. code-block:: c
> +
> +      rte_tel_data_start_array(d, RTE_TEL_INT_VAL);
> +          for(i = 0; i < 5; i++)
> +              rte_tel_data_add_array_int(d, i);
> +
> +  The resulting response to the client shows the list data provided above
> +  by the handler function in the library/app, placed in a JSON reply by
> +  telemetry::

Indent of normal text is wrong.

> -The data structure is then formatted into a JSON response before sending.
> -The resulting response shows the port list data provided above by the handler
> -function in ethdev, placed in a JSON reply by telemetry:
> +    {"/example_lib/five_ints": [0, 1, 2, 3, 4]}
>  
> -.. code-block:: console
>  
> -    {"/ethdev/list": [0, 1]}
> +Dictionary Data
> +^^^^^^^^^^^^^^^
> +
> +  For data that needs to be structured in a dictionary with key/value pairs,
> +  the data utilities API can also be used. For example, some information about
> +  a brownie recipe is constructed in the callback function shown below:
> +
> +  .. code-block:: c
> +
> +     rte_tel_data_start_dict(d);
> +     rte_tel_data_add_dict_string(d, "Recipe", "Brownies");
> +     rte_tel_data_add_dict_int(d, "Prep time (mins)", 25);
> +     rte_tel_data_add_dict_int(d, "Cooking time (mins)", 30);
> +     rte_tel_data_add_dict_int(d, "Serves", 16);
> +
> +  The resulting response to the client shows the key/value data provided above
> +  by the handler function in telemetry, placed in a JSON reply by telemetry::
> +
> +    {"/example_lib/brownie_recipe": {"Recipe": "Brownies", "Prep time (mins)": 25,
> +      "Cooking time (mins)": 30, "Serves": 16}}

Indent issue in the section and below as well.

> +
> +
> +String Data
> +^^^^^^^^^^^
> +
> +  Telemetry also supports single string data. The data utilities API can again
> +  be used for this, see the example below.
> +
> +  .. code-block:: c
> +
> +     rte_tel_data_string(d, "This is an example string");
> +
> +  Giving the following response to the client::
> +
> +    {"/example_lib/string_example": "This is an example string"}
[...]
> +Using Commands
> +--------------
> +
> +To use commands, with a DPDK app running (e.g. testpmd), use the
> +dpdk-telemetry.py script. For details on its use, see the :doc:`../howto/telemetry`.

script name should be in ``


Applied with above changes.



      parent reply	other threads:[~2020-07-30 18:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21 16:09 [dpdk-dev] [PATCH v2] " Ciara Power
2020-07-21 17:38 ` Bruce Richardson
2020-07-22 17:27 ` Thomas Monjalon
2020-07-24 11:32   ` Power, Ciara
2020-07-24 11:20 ` [dpdk-dev] [PATCH v3] " Ciara Power
2020-07-24 11:45   ` Power, Ciara
2020-07-30 18:28   ` Thomas Monjalon [this message]

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=3728578.6CtKLKD1J2@thomas \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=ciara.power@intel.com \
    --cc=dev@dpdk.org \
    --cc=kevin.laatz@intel.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).