mirror of https://github.com/aredn/aredn.git
More neighbor stats (#1357)
This commit is contained in:
parent
409ad3f099
commit
b06d34e8e4
|
@ -251,6 +251,20 @@ if (tracker) {
|
|||
<div>avg tx</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cols">
|
||||
<div class="i">
|
||||
<div>{{type(n.rev_ping_success_time) ? sprintf("%.1f ms", n.rev_ping_success_time * 1000) : "-"}}</div>
|
||||
<div>neighbor ping time</div>
|
||||
</div>
|
||||
<div class="i">
|
||||
<div>{{type(n.rev_ping_quality) ? sprintf("%d%%", n.rev_ping_quality) : "-"}}</div>
|
||||
<div>neighbor ping success</div>
|
||||
</div>
|
||||
<div class="i">
|
||||
<div>{{type(n.rev_quality) ? sprintf("%d%%", 100 - n.rev_quality) : "-"}}</div>
|
||||
<div>neighbor errors</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if (n.type == "RF") { %}
|
||||
<div class="cols">
|
||||
<div class="i">
|
||||
|
|
|
@ -569,7 +569,10 @@ function lqm()
|
|||
avg_tx_fail = nil,
|
||||
node_route_count = 0,
|
||||
leaf = nil,
|
||||
rev_leaf = nil
|
||||
rev_leaf = nil,
|
||||
rev_ping_quality = nil,
|
||||
rev_ping_success_time = nil,
|
||||
rev_quality = nil
|
||||
}
|
||||
end
|
||||
local track = tracker[station.mac]
|
||||
|
@ -642,6 +645,9 @@ function lqm()
|
|||
track.refresh = is_pending(track) and 0 or now + refresh_retry_timeout
|
||||
track.rev_snr = nil
|
||||
track.rev_leaf = nil
|
||||
track.rev_ping_success_time = nil
|
||||
track.rev_ping_quality = nil
|
||||
track.rev_quality = nil
|
||||
else
|
||||
local raw = io.popen(CURL .. " --retry 0 --connect-timeout " .. connect_timeout .. " --speed-time " .. speed_time .. " --speed-limit " .. speed_limit .. " -s \"http://" .. track.ip .. ":8080/cgi-bin/sysinfo.json?link_info=1&lqm=1\" -o - 2> /dev/null")
|
||||
local info = luci.jsonc.parse(raw:read("*a"))
|
||||
|
@ -655,6 +661,9 @@ function lqm()
|
|||
track.refresh = is_pending(track) and 0 or now + refresh_retry_timeout
|
||||
track.rev_snr = nil
|
||||
track.rev_leaf = nil
|
||||
track.rev_ping_success_time = nil
|
||||
track.rev_ping_quality = nil
|
||||
track.rev_quality = nil
|
||||
else
|
||||
track.refresh = is_pending(track) and 0 or now + refresh_timeout()
|
||||
|
||||
|
@ -678,6 +687,18 @@ function lqm()
|
|||
track.firmware_version = info.node_details.firmware_version
|
||||
end
|
||||
|
||||
if info.lqm and info.lqm.enabled and info.lqm.info and info.lqm.info.trackers then
|
||||
for _, rtrack in pairs(info.lqm.info.trackers)
|
||||
do
|
||||
if myhostname == canonical_hostname(rtrack.hostname) then
|
||||
track.rev_ping_success_time = rtrack.ping_success_time
|
||||
track.rev_ping_quality = rtrack.ping_quality
|
||||
track.rev_quality = rtrack.quality
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if track.type == "RF" then
|
||||
rflinks[track.mac] = nil
|
||||
if info.lqm and info.lqm.enabled and info.lqm.info and info.lqm.info.trackers then
|
||||
|
|
Loading…
Reference in New Issue