Skip to content

Commit

Permalink
Safety check
Browse files Browse the repository at this point in the history
  • Loading branch information
cardigliano committed Feb 7, 2025
1 parent b5b9f57 commit deafbd2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/lua/get_flows_data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -417,12 +417,13 @@ for _key, value in ipairs(flows_stats) do -- pairsByValues(vals, funct) do

record["column_thpt"] = column_thpt

local cli2srv = round((value["cli2srv.bytes"] * 100) / value["bytes"], 0)

record["column_breakdown"] =
"<div class='progress'><div class='progress-bar bg-warning' style='width: " .. cli2srv ..
if value["bytes"] > 0 then
local cli2srv = round((value["cli2srv.bytes"] * 100) / value["bytes"], 0)
record["column_breakdown"] =
"<div class='progress'><div class='progress-bar bg-warning' style='width: " .. cli2srv ..
"%;'>Client</div><div class='progress-bar bg-success' style='width: " .. (100 - cli2srv) ..
"%;'>Server</div></div>"
end

local info

Expand Down

0 comments on commit deafbd2

Please sign in to comment.