mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Manually merge of https://github.com/ntop/ntopng/pull/185
This commit is contained in:
parent
dce301d370
commit
5b5e7cb8ca
2 changed files with 25 additions and 25 deletions
|
|
@ -489,18 +489,18 @@ print(' <tr><th> </th><th>Time</th><th>Value</th></tr>\n')
|
|||
rrd = rrd2json(ifid, host, rrdFile, start_time, end_time, true)
|
||||
|
||||
if(string.contains(rrdFile, "num_") or string.contains(rrdFile, "packets") or string.contains(rrdFile, "drops")) then
|
||||
print(' <tr><th>Min</th><td>' .. os.date("%x %X", rrd.minval_time) .. '</td><td>' .. formatValue(ret.minval) .. '</td></tr>\n')
|
||||
print(' <tr><th>Max</th><td>' .. os.date("%x %X", ret.maxval_time) .. '</td><td>' .. formatValue(ret.maxval) .. '</td></tr>\n')
|
||||
print(' <tr><th>Last</th><td>' .. os.date("%x %X", last_time) .. '</td><td>' .. formatValue(round(ret.lastval), 1) .. '</td></tr>\n')
|
||||
print(' <tr><th>Average</th><td colspan=2>' .. formatValue(round(ret.average, 2)) .. '</td></tr>\n')
|
||||
print(' <tr><th>Total Number</th><td colspan=2>' .. formatValue(round(ret.total_bytes)) .. '</td></tr>\n')
|
||||
print(' <tr><th>Min</th><td>' .. os.date("%x %X", rrd.minval_time) .. '</td><td>' .. formatValue(rrd.minval) .. '</td></tr>\n')
|
||||
print(' <tr><th>Max</th><td>' .. os.date("%x %X", rrd.maxval_time) .. '</td><td>' .. formatValue(rrd.maxval) .. '</td></tr>\n')
|
||||
print(' <tr><th>Last</th><td>' .. os.date("%x %X", last_time) .. '</td><td>' .. formatValue(round(rrd.lastval), 1) .. '</td></tr>\n')
|
||||
print(' <tr><th>Average</th><td colspan=2>' .. formatValue(round(rrd.average, 2)) .. '</td></tr>\n')
|
||||
print(' <tr><th>Total Number</th><td colspan=2>' .. formatValue(round(rrd.total_bytes)) .. '</td></tr>\n')
|
||||
else
|
||||
formatter_fctn = "fbits"
|
||||
print(' <tr><th>Min</th><td>' .. os.date("%x %X", rrd.minval_time) .. '</td><td>' .. bitsToSize(ret.minval) .. '</td></tr>\n')
|
||||
print(' <tr><th>Max</th><td>' .. os.date("%x %X", ret.maxval_time) .. '</td><td>' .. bitsToSize(ret.maxval) .. '</td></tr>\n')
|
||||
print(' <tr><th>Last</th><td>' .. os.date("%x %X", last_time) .. '</td><td>' .. bitsToSize(ret.lastval) .. '</td></tr>\n')
|
||||
print(' <tr><th>Average</th><td colspan=2>' .. bitsToSize(ret.average*8) .. '</td></tr>\n')
|
||||
print(' <tr><th>Total Traffic</th><td colspan=2>' .. bytesToSize(ret.total_bytes) .. '</td></tr>\n')
|
||||
print(' <tr><th>Min</th><td>' .. os.date("%x %X", rrd.minval_time) .. '</td><td>' .. bitsToSize(rrd.minval) .. '</td></tr>\n')
|
||||
print(' <tr><th>Max</th><td>' .. os.date("%x %X", rrd.maxval_time) .. '</td><td>' .. bitsToSize(rrd.maxval) .. '</td></tr>\n')
|
||||
print(' <tr><th>Last</th><td>' .. os.date("%x %X", last_time) .. '</td><td>' .. bitsToSize(rrd.lastval) .. '</td></tr>\n')
|
||||
print(' <tr><th>Average</th><td colspan=2>' .. bitsToSize(rrd.average*8) .. '</td></tr>\n')
|
||||
print(' <tr><th>Total Traffic</th><td colspan=2>' .. bytesToSize(rrd.total_bytes) .. '</td></tr>\n')
|
||||
end
|
||||
|
||||
print(' <tr><th>Selection Time</th><td colspan=2><div id=when></div></td></tr>\n')
|
||||
|
|
@ -1291,11 +1291,6 @@ function singlerrd2json(ifid, host, rrdFile, start_time, end_time, rickshaw_json
|
|||
end
|
||||
end
|
||||
|
||||
if(w > 0) then
|
||||
lastval_bits_time = s[0]
|
||||
lastval_bits = w
|
||||
end
|
||||
|
||||
if (s[elemId] == nil) then s[elemId] = 0 end
|
||||
s[elemId] = s[elemId] + w*8 -- bps
|
||||
--if(s[elemId] > 0) then io.write("[".. elemId .. "]=" .. s[elemId] .."\n") end
|
||||
|
|
@ -1304,7 +1299,7 @@ function singlerrd2json(ifid, host, rrdFile, start_time, end_time, rickshaw_json
|
|||
|
||||
if(sampling == sample_rate) then
|
||||
for elemId=1,#s do
|
||||
s[elemId] = s[elemId] / sample_rate
|
||||
s[elemId] = s[elemId] / sample_rate
|
||||
end
|
||||
series[#series+1] = s
|
||||
sampling = 1
|
||||
|
|
@ -1486,7 +1481,7 @@ function singlerrd2json(ifid, host, rrdFile, start_time, end_time, rickshaw_json
|
|||
json_ret = '{}'
|
||||
end
|
||||
|
||||
ret = {}
|
||||
local ret = {}
|
||||
ret.maxval_time = maxval_time
|
||||
ret.maxval = round(maxval, 0)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue