hsa: clean up vpp_echo json output 95/21595/2
authorDave Wallace <dwallacelf@gmail.com>
Thu, 22 Aug 2019 21:15:54 +0000 (21:15 +0000)
committerDave Wallace <dwallacelf@gmail.com>
Wed, 28 Aug 2019 21:19:39 +0000 (21:19 +0000)
Type: style

Change-Id: I8dbf2197b78690b94a346d6ff564648ab42f8235
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
src/plugins/hs_apps/sapi/vpp_echo.c

index 612bdb9..1899759 100644 (file)
@@ -128,21 +128,23 @@ print_global_json_stats (echo_main_t * em)
   u8 *end_evt =
     format (0, "%U", echo_format_timing_event, em->timing.end_event);
   fformat (stdout, "{\n");
-  fformat (stdout, "\"time\": \"%.9f\",\n", deltat);
-  fformat (stdout, "\"start_evt\": \"%s\",\n", start_evt);
-  fformat (stdout, "\"end_evt\": \"%s\",\n", end_evt);
-  fformat (stdout, "\"rx_data\": %lld,\n", em->stats.rx_total);
-  fformat (stdout, "\"tx_rx\": %lld,\n", em->stats.tx_total);
-  fformat (stdout, "\"closing\": {\n");
-  fformat (stdout, "  \"reset\": { \"q\": %d, \"s\": %d },\n",
+  fformat (stdout, "  \"role\": \"%s\",\n",
+          em->i_am_master ? "server" : "client");
+  fformat (stdout, "  \"time\": \"%.9f\",\n", deltat);
+  fformat (stdout, "  \"start_evt\": \"%s\",\n", start_evt);
+  fformat (stdout, "  \"end_evt\": \"%s\",\n", end_evt);
+  fformat (stdout, "  \"rx_data\": %lld,\n", em->stats.rx_total);
+  fformat (stdout, "  \"tx_rx\": %lld,\n", em->stats.tx_total);
+  fformat (stdout, "  \"closing\": {\n");
+  fformat (stdout, "    \"reset\": { \"q\": %d, \"s\": %d },\n",
           em->stats.reset_count.q, em->stats.reset_count.s);
-  fformat (stdout, "  \"close\": { \"q\": %d, \"s\": %d },\n",
+  fformat (stdout, "    \"close\": { \"q\": %d, \"s\": %d },\n",
           em->stats.close_count.q, em->stats.close_count.s);
-  fformat (stdout, "  \"active\": { \"q\": %d, \"s\": %d },\n",
+  fformat (stdout, "    \"active\": { \"q\": %d, \"s\": %d },\n",
           em->stats.active_count.q, em->stats.active_count.s);
-  fformat (stdout, "  \"clean\": { \"q\": %d, \"s\": %d }\n",
+  fformat (stdout, "    \"clean\": { \"q\": %d, \"s\": %d }\n",
           em->stats.clean_count.q, em->stats.clean_count.s);
-  fformat (stdout, "}\n");
+  fformat (stdout, "  }\n");
   fformat (stdout, "}\n");
 }