mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Show information about individual active queues
This commit is contained in:
parent
2674e1cb8b
commit
b530916044
4 changed files with 27 additions and 3 deletions
|
@ -527,7 +527,17 @@ func (a *admin) getData_getSwitchQueues() admin_nodeInfo {
|
|||
var peerInfos admin_nodeInfo
|
||||
switchTable := a.core.switchTable
|
||||
getSwitchQueues := func() {
|
||||
queues := make([]map[string]interface{}, 0)
|
||||
for k, v := range switchTable.queues.bufs {
|
||||
queue := map[string]interface{}{
|
||||
"queue_id": k,
|
||||
"queue_size": v.size,
|
||||
"queue_packets": len(v.packets),
|
||||
}
|
||||
queues = append(queues, queue)
|
||||
}
|
||||
peerInfos = admin_nodeInfo{
|
||||
{"queues", queues},
|
||||
{"queues_count", len(switchTable.queues.bufs)},
|
||||
{"queues_size", switchTable.queues.size},
|
||||
{"max_queues_count", switchTable.queues.maxbufs},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue