]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Improve reading of operator expression 16484/head
authorJosh Soref <2119212+jsoref@users.noreply.github.com>
Thu, 13 Nov 2025 00:44:48 +0000 (19:44 -0500)
committerJosh Soref <2119212+jsoref@users.noreply.github.com>
Thu, 13 Nov 2025 03:59:31 +0000 (22:59 -0500)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
pdns/dnsdistdist/html/local.js

index 4f9f125509934fd5333d356510eb3eb63a21a853..aec38feb89ac8f159baa46314865bf636ce59964 100644 (file)
@@ -158,16 +158,16 @@ $(document).ready(function() {
                 if(!gdata["cpu-sys-msec"]) 
                     gdata=data;
 
-                var cpu=((1.0*data["cpu-sys-msec"]+1.0*data["cpu-user-msec"] - 1.0*gdata["cpu-sys-msec"]-1.0*gdata["cpu-user-msec"])/10.0);
+                var cpu=((1*data["cpu-sys-msec"] + 1*data["cpu-user-msec"]) - (1*gdata["cpu-sys-msec"] + 1*gdata["cpu-user-msec"]))/10.0;
 
                 $("#cpu").text(cpu.toFixed(2));
                 var qps=1.0*data["queries"]-1.0*gdata["queries"];
                 $("#qps").text(qps.toFixed(2));
                 $("#server-policy").text(data["server-policy"]);
 
-                var servfailps=1.0*data["servfail-responses"]-1.0*gdata["servfail-responses"];
+                var servfailps=(1*data["servfail-responses"]) - (1*gdata["servfail-responses"]);
 
-                var totpcache=1.0*data["cache-hits"]-1.0*gdata["cache-hits"]+1.0*data["cache-misses"]-1.0*gdata["cache-misses"];
+                var totpcache=(1*data["cache-hits"] + 1*data["cache-misses"]) - (1*gdata["cache-hits"] + 1*gdata["cache-misses"]);
                 var hitrate=0;
                 if(totpcache > 0) {
                     hitrate=100.0*(data["cache-hits"]-1.0*gdata["cache-hits"])/totpcache;