Fixed show mem yspec vs ydomain issue

This commit is contained in:
Olof hagsand 2024-10-28 10:39:04 +01:00
parent 947128339c
commit 54a8f51bfd
3 changed files with 126 additions and 5 deletions

View file

@ -425,9 +425,9 @@ clixon_stats_datastore_get(clixon_handle h,
* @retval -1 Error
*/
static int
clixon_stats_module_get(clixon_handle h,
yang_stmt *ys,
cbuf *cb)
clixon_stats_yang_get(clixon_handle h,
yang_stmt *ys,
cbuf *cb)
{
int retval = -1;
uint64_t nr = 0;
@ -1466,13 +1466,13 @@ from_client_stats(clixon_handle h,
while ((yspec = yn_iter(ydomain, &inext2)) != NULL) {
cprintf(cbret, "<module-set>");
cprintf(cbret, "<name>%s/%s</name>", domain, yang_argument_get(yspec));
if (clixon_stats_module_get(h, ydomain, cbret) < 0)
if (clixon_stats_yang_get(h, yspec, cbret) < 0)
goto done;
if (modules){
inext3 = 0;
while ((ymodule = yn_iter(yspec, &inext3)) != NULL) {
cprintf(cbret, "<module><name>%s</name>", yang_argument_get(ymodule));
if (clixon_stats_module_get(h, ymodule, cbret) < 0)
if (clixon_stats_yang_get(h, ymodule, cbret) < 0)
goto done;
cprintf(cbret, "</module>");
}

View file

@ -1936,6 +1936,8 @@ cli_show_statistics(clixon_handle h,
goto done;
}
if (cli) {
if (backend)
cligen_output(stdout, "CLI:\n====\n");
if (!detail) {
cligen_output(stdout, "%-25s %-10s\n", "YANG", "Mem");
}
@ -2004,6 +2006,8 @@ cli_show_statistics(clixon_handle h,
}
}
if (backend) {
if (cli)
cligen_output(stdout, "\nBackend:\n========\n");
cprintf(cb, "<rpc xmlns=\"%s\"", NETCONF_BASE_NAMESPACE);
cprintf(cb, " %s", NETCONF_MESSAGE_ID_ATTR); /* XXX: use incrementing sequence */
cprintf(cb, ">");