aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq
diff options
context:
space:
mode:
authorAndre Heider <a.heider@gmail.com>2018-12-10 10:06:50 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2018-12-16 00:57:19 +0100
commit5d501e54fc3b4e9c948b2c78a551abb285d89554 (patch)
treec0ef3ea2ef0b4f76f49566ec36d8ee134292682b /target/linux/lantiq
parentd8f861f40818fae0b4e712cce31f2399ab051868 (diff)
downloadupstream-5d501e54fc3b4e9c948b2c78a551abb285d89554.tar.gz
upstream-5d501e54fc3b4e9c948b2c78a551abb285d89554.tar.bz2
upstream-5d501e54fc3b4e9c948b2c78a551abb285d89554.zip
lantiq: add integer latency stat for lantiq-dsl
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>
Diffstat (limited to 'target/linux/lantiq')
-rwxr-xr-xtarget/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
index a76fec94ed..8665240da4 100755
--- a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
+++ b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
@@ -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
#
@@ -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\""