summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSindhu Parvathi Gopinathan <sgopinathan@nvidia.com>2023-07-18 23:53:15 -0700
committerChirag Shah <chirag@nvidia.com>2023-07-21 10:15:11 -0700
commit1c67c0951bf39648ca6593449ec234aa6e046304 (patch)
tree84fa954c113f0c6f764fd9c4e95cf6f1a994e39b
parent90f1e4e01781ffdba13a65577329e6380d96cee5 (diff)
zebra: non pretty json output for show ip route
Currently, json output of show ip route command are no pretty format. This is an extremely expensive operation at high scale (with high number of routes with many paths). Zebra json non-pretty command support added: ``` show ip route json ``` Ticket:#3513256 Issue:3513256 Testing: UT done Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
-rw-r--r--zebra/zebra_vty.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 19366eb2c1..291c2eb7e0 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -962,8 +962,12 @@ static void do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf,
}
}
+ /*
+ * This is an extremely expensive operation at scale
+ * and non-pretty reduces memory footprint significantly.
+ */
if (use_json)
- vty_json(vty, json);
+ vty_json_no_pretty(vty, json);
}
static void do_show_ip_route_all(struct vty *vty, struct zebra_vrf *zvrf,