require "lua_utils" local format_utils = require "format_utils" local os_utils = require "os_utils" -- Get from redis the throughput type bps or pps local throughput_type = getThroughputType() local now = os.time() function vlan2record(ifId, vlan) local record = {} record["key"] = tostring(vlan["vlan_id"]) local vlan_link = ""..getFullVlanName(vlan["vlan_id"])..'' record["column_vlan"] = vlan_link record["column_score"] = vlan["score"] > 0 and format_utils.formatValue(vlan["score"]) or '' record["column_hosts"] = format_utils.formatValue(vlan["num_hosts"]) record["column_since"] = secondsToTime(now - vlan["seen.first"] + 1) local sent2rcvd = round((vlan["bytes.sent"] * 100) / (vlan["bytes.sent"] + vlan["bytes.rcvd"]), 0) record["column_breakdown"] = "