Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zebra: show command to display metaq info #18497

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

krishna-samy
Copy link
Contributor

@krishna-samy krishna-samy commented Mar 25, 2025

Display below info from metaq and sub queues

  1. Current queue size
  2. Max/Highwater size
  3. Total number of events received fo so far
r1# sh zebra metaq
MetaQ Summary
Current Size    : 0
Max Size        : 9
Total           : 20
 |------------------------------------------------------------------|
 | SubQ                             | Current  | Max Size  | Total  |
 |----------------------------------+----------+-----------+--------|
 | NHG Objects                      | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | EVPN/VxLan Objects               | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | Early Route Processing           | 0        | 8         | 11     |
 |----------------------------------+----------+-----------+--------|
 | Early Label Handling             | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | Connected Routes                 | 0        | 6         | 9      |
 |----------------------------------+----------+-----------+--------|
 | Kernel Routes                    | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | Static Routes                    | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | RIP/OSPF/ISIS/EIGRP/NHRP Routes  | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | BGP Routes                       | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | Other Routes                     | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | Graceful Restart                 | 0        | 0         | 0      |
 |------------------------------------------------------------------|

@frrbot frrbot bot added the zebra label Mar 25, 2025
@riw777 riw777 self-requested a review March 25, 2025 15:17
@Jafaral
Copy link
Member

Jafaral commented Mar 25, 2025

Thanks @krishna-samy . Can you please move the Current Size, Max Size, and Total as table header instead of repeating those every line?

@krishna-samy
Copy link
Contributor Author

Thanks @krishna-samy . Can you please move the Current Size, Max Size, and Total as table header instead of repeating those every line?

@Jafaral - Done

@krishna-samy
Copy link
Contributor Author

krishna-samy commented Mar 25, 2025

New output format:

image

@mjstapp
Copy link
Contributor

mjstapp commented Mar 25, 2025

have you looked at lib/termtable - we have some infra that helps with tables? and it looks like it may have some json help too?

Display below info from metaq and sub queues
1. Current queue size
2. Max/Highwater size
3. Total number of events received fo so far

r1# sh zebra metaq
MetaQ Summary
Current Size    : 0
Max Size        : 9
Total           : 20
 |------------------------------------------------------------------|
 | SubQ                             | Current  | Max Size  | Total  |
 |----------------------------------+----------+-----------+--------|
 | NHG Objects                      | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | EVPN/VxLan Objects               | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | Early Route Processing           | 0        | 8         | 11     |
 |----------------------------------+----------+-----------+--------|
 | Early Label Handling             | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | Connected Routes                 | 0        | 6         | 9      |
 |----------------------------------+----------+-----------+--------|
 | Kernel Routes                    | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | Static Routes                    | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | RIP/OSPF/ISIS/EIGRP/NHRP Routes  | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | BGP Routes                       | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | Other Routes                     | 0        | 0         | 0      |
 |----------------------------------+----------+-----------+--------|
 | Graceful Restart                 | 0        | 0         | 0      |
 |------------------------------------------------------------------|

Signed-off-by: Krishnasamy <[email protected]>
@krishna-samy
Copy link
Contributor Author

krishna-samy commented Mar 26, 2025

Output

r1# sh zebra metaq json
{
"currentSize":0,
"maxSize":9,
"total":20,
"subqueues":[
{
"SubQ":"NHG Objects",
"Current":"0",
"Max Size":"0",
"Total":"0"
},
{
"SubQ":"EVPN/VxLan Objects",
"Current":"0",
"Max Size":"0",
"Total":"0"
},
{
"SubQ":"Early Route Processing",
"Current":"0",
"Max Size":"8",
"Total":"11"
},
{
"SubQ":"Early Label Handling",
"Current":"0",
"Max Size":"0",
"Total":"0"
},
{
"SubQ":"Connected Routes",
"Current":"0",
"Max Size":"6",
"Total":"9"
},
{
"SubQ":"Kernel Routes",
"Current":"0",
"Max Size":"0",
"Total":"0"
},
{
"SubQ":"Static Routes",
"Current":"0",
"Max Size":"0",
"Total":"0"
},
{
"SubQ":"RIP/OSPF/ISIS/EIGRP/NHRP Routes",
"Current":"0",
"Max Size":"0",
"Total":"0"
},
{
"SubQ":"BGP Routes",
"Current":"0",
"Max Size":"0",
"Total":"0"
},
{
"SubQ":"Other Routes",
"Current":"0",
"Max Size":"0",
"Total":"0"
},
{
"SubQ":"Graceful Restart",
"Current":"0",
"Max Size":"0",
"Total":"0"
}
]
}

@krishna-samy
Copy link
Contributor Author

have you looked at lib/termtable - we have some infra that helps with tables? and it looks like it may have some json help too?

@mjstapp - Done. Please check

@mjstapp
Copy link
Contributor

mjstapp commented Mar 26, 2025

neat, thanks - but it looks like the subqueue numbers are presented as strings in their json objects - only the top-level object is using integers?

can you show the ttable text output too, so we can see it?

have you looked at lib/termtable - we have some infra that helps with tables? and it looks like it may have some json help too?

@mjstapp - Done. Please check

@krishna-samy
Copy link
Contributor Author

neat, thanks - but it looks like the subqueue numbers are presented as strings in their json objects - only the top-level object is using integers?

can you show the ttable text output too, so we can see it?

have you looked at lib/termtable - we have some infra that helps with tables? and it looks like it may have some json help too?

@mjstapp - Done. Please check

@mjstapp
Do you mean the show command's text output? I have shared the text output in the commit message.

@krishna-samy
Copy link
Contributor Author

@mjstapp
Show command text Output:
image


/* Convert the table to JSON and add it to the main JSON object */
/* n = name/string, u = unsigned int */
json_object *json_table = ttable_json(tt, "nuuu");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at the lib, that format string should be "sddd" ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants