]> granicus.if.org Git - pdns/commitdiff
Expose server latency in dnsdist API/WebUI
authorJan Broer <janeczku@yahoo.de>
Sun, 10 Jan 2016 14:43:58 +0000 (15:43 +0100)
committerJan Broer <janeczku@yahoo.de>
Sun, 10 Jan 2016 14:43:58 +0000 (15:43 +0100)
pdns/dnsdist-web.cc
pdns/dnsdistdist/html/local.js

index ffef89bcc70aa48a8a65173c123bd1aa57eb98e8..e4c2f76cb5b5a7579699d94ab3c3ef7f16e01cb2 100644 (file)
@@ -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);
index 84afcf7373a59235014dc4b7c3d6734d4ebee18c..63f65477e296aead534ae8b2216300b65fea3ab9 100644 (file)
@@ -187,10 +187,10 @@ $(document).ready(function() {
                      $("#version").text(data["daemon_type"]+" "+data["version"]);
                      $("#acl").text(data["acl"]);
                      $("#local").text(data["local"]);
-                     var bouw='<table width="100%"><tr align=right><th>#</th><th align=left>Name</th><th align=left>Address</th><th>Status</th><th>Queries</th><th>Drops</th><th>QPS</th><th>Out</th><th>Weight</th><th>Order</th><th align=left>Pools</th></tr>';
+                     var bouw='<table width="100%"><tr align=right><th>#</th><th align=left>Name</th><th align=left>Address</th><th>Status</th><th>Latency</th><th>Queries</th><th>Drops</th><th>QPS</th><th>Out</th><th>Weight</th><th>Order</th><th align=left>Pools</th></tr>';
                      $.each(data["servers"], function(a,b) {
                          bouw = bouw + ("<tr align=right><td>"+b["id"]+"</td><td align=left>"+b["name"]+"</td><td align=left>"+b["address"]+"</td><td>"+b["state"]+"</td>");
-                         bouw = bouw + ("<td>"+b["queries"]+"</td><td>"+b["reuseds"]+"</td><td>"+b["qps"]+"</td><td>"+b["outstanding"]+"</td>");
+                         bouw = bouw + ("<td>"+b["latency"]+"</td><td>"+b["queries"]+"</td><td>"+b["reuseds"]+"</td><td>"+b["qps"]+"</td><td>"+b["outstanding"]+"</td>");
                          bouw = bouw + ("<td>"+b["weight"]+"</td><td>"+b["order"]+"</td><td align=left>"+b["pools"]+"</td></tr>");
                      }); 
                      bouw = bouw + "</table>";