require "lua_utils" -- Get from redis the throughput type bps or pps local throughput_type = getThroughputType() local now = os.time() function mac2record(mac) local record = {} record["key"] = hostinfo2jqueryid(mac) local link = ""..mac["mac"]..'' if not isSpecialMac(mac["mac"]) then local icon = getHostIcon(mac["mac"]) if(icon ~= "") then link = link.." "..icon end end record["column_mac"] = link local manufacturer = get_manufacturer_mac(mac["mac"]) if(manufacturer == nil) then manufacturer = "" end record["column_manufacturer"] = manufacturer record["column_hosts"] = mac["num_hosts"].."" record["column_since"] = secondsToTime(now - mac["seen.first"]+1) local sent2rcvd = round((mac["bytes.sent"] * 100) / (mac["bytes.sent"] + mac["bytes.rcvd"]), 0) record["column_breakdown"] = "