From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Thu, 13 Nov 2025 00:44:48 +0000 (-0500) Subject: Improve reading of operator expression X-Git-Tag: rec-5.4.0-alpha1~75^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16484%2Fhead;p=thirdparty%2Fpdns.git Improve reading of operator expression Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- diff --git a/pdns/dnsdistdist/html/local.js b/pdns/dnsdistdist/html/local.js index 4f9f125509..aec38feb89 100644 --- a/pdns/dnsdistdist/html/local.js +++ b/pdns/dnsdistdist/html/local.js @@ -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;