Skip to content

Commit

Permalink
lantiq: add integer latency stat for lantiq-dsl
Browse files Browse the repository at this point in the history
The current stats always have a 'ms' suffix, and they're used by luci.
Introduce dsl.latency_[down|up] values, exported in µs without suffix.

Signed-off-by: Andre Heider <a.heider@gmail.com>
  • Loading branch information
dhewg authored and hauke committed Dec 15, 2018
1 parent d8f861f commit 5d501e5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
Expand Up @@ -64,6 +64,12 @@ scale_latency() {
printf "%d.%d ms" ${a} ${b}
}

scale_latency_us() {
local val=$1

expr $val \* 10
}

#
# convert vendorid into human readable form
#
Expand Down Expand Up @@ -428,6 +434,8 @@ latency_delay() {
sidd=$(scale_latency $idd)

if [ "$action" = "lucistat" ]; then
echo "dsl.latency_down=\"$(scale_latency_us $idd)\""
echo "dsl.latency_up=\"$(scale_latency_us $idu)\""
echo "dsl.latency_num_down=\"$sidd\""
echo "dsl.latency_num_up=\"$sidu\""
echo "dsl.latency_s_down=\"$idd_s\""
Expand Down

0 comments on commit 5d501e5

Please sign in to comment.