From f20fbb61be5285a1a5f07718135d7acac1e43f8d Mon Sep 17 00:00:00 2001 From: Jan Broer Date: Sun, 10 Jan 2016 15:43:58 +0100 Subject: [PATCH] Expose server latency in dnsdist API/WebUI --- pdns/dnsdist-web.cc | 1 + pdns/dnsdistdist/html/local.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pdns/dnsdist-web.cc b/pdns/dnsdist-web.cc index ffef89bcc..e4c2f76cb 100644 --- a/pdns/dnsdist-web.cc +++ b/pdns/dnsdist-web.cc @@ -148,6 +148,7 @@ static void connectionThread(int sock, ComboAddress remote, string password) {"weight", (int)a->weight}, {"order", (int)a->order}, {"pools", pools}, + {"latency", (int)(a->latencyUsec/1000.0)}, {"queries", (int)a->queries}}; servers.push_back(server); diff --git a/pdns/dnsdistdist/html/local.js b/pdns/dnsdistdist/html/local.js index 84afcf737..63f65477e 100644 --- a/pdns/dnsdistdist/html/local.js +++ b/pdns/dnsdistdist/html/local.js @@ -187,10 +187,10 @@ $(document).ready(function() { $("#version").text(data["daemon_type"]+" "+data["version"]); $("#acl").text(data["acl"]); $("#local").text(data["local"]); - var bouw=''; + var bouw='
#NameAddressStatusQueriesDropsQPSOutWeightOrderPools
'; $.each(data["servers"], function(a,b) { bouw = bouw + (""); - bouw = bouw + (""); + bouw = bouw + (""); bouw = bouw + (""); }); bouw = bouw + "
#NameAddressStatusLatencyQueriesDropsQPSOutWeightOrderPools
"+b["id"]+""+b["name"]+""+b["address"]+""+b["state"]+""+b["queries"]+""+b["reuseds"]+""+b["qps"]+""+b["outstanding"]+""+b["latency"]+""+b["queries"]+""+b["reuseds"]+""+b["qps"]+""+b["outstanding"]+""+b["weight"]+""+b["order"]+""+b["pools"]+"
"; -- 2.40.0