From: bert hubert Date: Sun, 22 Nov 2015 12:54:44 +0000 (+0100) Subject: fix outrageous latency precision in web-page, also report server-policy via JSON... X-Git-Tag: dnsdist-1.0.0-alpha1~210^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b81b87102aecb1158ab7013153c632315a5c5a94;p=thirdparty%2Fpdns.git fix outrageous latency precision in web-page, also report server-policy via JSON & web-page --- diff --git a/pdns/dnsdist-web.cc b/pdns/dnsdist-web.cc index 032c6d40d5..e224fe46e4 100644 --- a/pdns/dnsdist-web.cc +++ b/pdns/dnsdist-web.cc @@ -83,7 +83,8 @@ static void connectionThread(int sock, ComboAddress remote, string password) { "packetcache-hits", 0}, { "packetcache-misses", 0}, { "over-capacity-drops", 0 }, - { "too-old-drops", 0 } + { "too-old-drops", 0 }, + { "server-policy", g_policy.getLocal()->name} }; for(const auto& e : g_stats.entries) { diff --git a/pdns/dnsdistdist/html/index.html b/pdns/dnsdistdist/html/index.html index 82530da3f4..9c27b990d9 100644 --- a/pdns/dnsdistdist/html/index.html +++ b/pdns/dnsdistdist/html/index.html @@ -51,7 +51,7 @@ alt="Fork me on GitHub">

Version: , uptime: , Number of queries: ( qps)
-Average response time: ms, CPU Usage: %
+Average response time: ms, CPU Usage: %, Server selection policy:

diff --git a/pdns/dnsdistdist/html/local.js b/pdns/dnsdistdist/html/local.js index 8ac3651353..1e9225b2c3 100644 --- a/pdns/dnsdistdist/html/local.js +++ b/pdns/dnsdistdist/html/local.js @@ -152,7 +152,7 @@ $(document).ready(function() { $("#over-capacity-drops").text(data["over-capacity-drops"]); $("#too-old").text(data["too-old-drops"]); $("#uptime").text(moment.duration(data["uptime"]*1000.0).humanize()); - $("#latency").text(data["latency-avg100"]/1000.0); + $("#latency").text((data["latency-avg100"]/1000.0).toFixed(2)); if(!gdata["cpu-sys-msec"]) gdata=data; @@ -161,6 +161,7 @@ $(document).ready(function() { $("#cpu").text(cpu.toFixed(2)); var qps=1.0*data["queries"]-1.0*gdata["queries"]; $("#qps").text(qps); + $("#server-policy").text(data["server-policy"]); var servfailps=1.0*data["servfail-responses"]-1.0*gdata["servfail-responses"];