Commit 70272b21 authored by Cool Fire's avatar Cool Fire

Fudge donut stats so the graph draws correctly

parent 8e50cdfd
......@@ -48,8 +48,8 @@ def getports(servers, ports)
dt = DateTime.parse(point['time'])
stamp = sprintf "%02d:%02d", dt.hour + 1, dt.minute
inrate = sprintf "%.2f", (point['ifInOctets_rate'].to_f * 8 / 1024 / 1024)
outrate = sprintf "%.2f", (point['ifOutOctets_rate'].to_f * 8 / 1024 / 1024)
inrate = sprintf "%.4f", (point['ifInOctets_rate'].to_f * 8 / 1024 / 1024)
outrate = sprintf "%.4f", (point['ifOutOctets_rate'].to_f * 8 / 1024 / 1024)
ports[i][0].push inrate
ports[i][1].push outrate
......@@ -100,6 +100,6 @@ vpn_bitrate = getports(vpn_ports, vpn_bitrate)
File.write 'vpn_bitrate.json', vpn_bitrate.to_json
File.write('vpn_bitrate_now.json', [
{'percent': (vpn_bitrate[0][0].last).to_f / 100, label: 'IN', 'color': 'green'},
{'percent': (vpn_bitrate[0][1].last).to_f / 100, label: 'OUT','color': 'cyan'}
{'percent': '%.4f' % ((vpn_bitrate[0][0].last).to_f / 100), label: 'IN', 'color': 'green'},
{'percent': '%.4f' % ((vpn_bitrate[0][1].last).to_f / 100), label: 'OUT','color': 'cyan'}
].to_json)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment