Skip to content

Commit

Permalink
Report aggregate values in addition to queue specific values
Browse files Browse the repository at this point in the history
  • Loading branch information
SX committed Mar 19, 2021
1 parent b7e595b commit b3f6eb2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ minetest.register_chatcommand("qos:queue_length", {
for i,_ in ipairs(QoS.data.queues) do
table.insert(rows, (" %s %d%%"):format(align(i, 8), QoS.utilization(i)))
end
minetest.chat_send_player(name, ("QoS queue lengths:\n%s"):format(table.concat(rows, "\n")))
local total = QoS.queue_length()
minetest.chat_send_player(name, ("QoS queue length %d in:\n%s"):format(total, table.concat(rows, "\n")))
end
end
})
Expand Down Expand Up @@ -65,7 +66,10 @@ minetest.register_chatcommand("qos:utilization", {
for i,_ in ipairs(QoS.data.queues) do
table.insert(rows, (" %s %d%%"):format(align(i, 8), QoS.utilization(i)))
end
minetest.chat_send_player(name, ("QoS queue utilization:\n%s"):format(table.concat(rows, "\n")))
local total = QoS.utilization()
minetest.chat_send_player(name, ("QoS queue utilization %d%% in:\n%s")
:format(total, table.concat(rows, "\n"))
)
end
end
})
Expand Down

0 comments on commit b3f6eb2

Please sign in to comment.