require "lua_utils" local graph_utils = require "graph_utils" -- Get from redis the throughput type bps or pps local throughput_type = getThroughputType() local now = os.time() function as2record(ifId, as) local record = {} record["key"] = tostring(as["asn"]) local as_link = ""..as["asn"]..'' record["column_asn"] = as_link record["column_asname"] = printASN(as["asn"], as["asname"]) record["column_score"] = as["score"] record["column_hosts"] = as["num_hosts"].."" record["column_since"] = secondsToTime(now - as["seen.first"] + 1) local sent2rcvd = round((as["bytes.sent"] * 100) / (as["bytes.sent"] + as["bytes.rcvd"]), 0) record["column_breakdown"] = "