]> granicus.if.org Git - pdns/commitdiff
dnsdist: Limit QPS and latency to two decimals in the web view
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 6 Jun 2018 12:53:41 +0000 (14:53 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 6 Jun 2018 12:53:41 +0000 (14:53 +0200)
pdns/dnsdistdist/html/local.js

index 26618447b5395a0f00a93b0c0c8e1cdf907dd51f..641a2797b4a72d8169be528b9973bf09475ca0e7 100644 (file)
@@ -159,7 +159,7 @@ $(document).ready(function() {
 
                 $("#cpu").text(cpu.toFixed(2));
                 var qps=1.0*data["queries"]-1.0*gdata["queries"];
-                $("#qps").text(qps);
+                $("#qps").text(qps.toFixed(2));
                 $("#server-policy").text(data["server-policy"]);
 
                 var servfailps=1.0*data["servfail-responses"]-1.0*gdata["servfail-responses"];
@@ -194,7 +194,7 @@ $(document).ready(function() {
                      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["latency"]+"</td><td>"+b["queries"]+"</td><td>"+b["reuseds"]+"</td><td>"+b["qps"]+"</td><td>"+b["outstanding"]+"</td>");
+                         bouw = bouw + ("<td>"+(b["latency"]).toFixed(2)+"</td><td>"+b["queries"]+"</td><td>"+b["reuseds"]+"</td><td>"+(b["qps"]).toFixed(2)+"</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>";