mirror of
https://github.com/pi-hole/web.git
synced 2026-02-15 07:25:39 +00:00
settings-system : Avoid division by zero in DNS metrics (#3533)
This commit is contained in:
@@ -139,7 +139,7 @@ function setMetrics(data, prefix) {
|
||||
cacheData[val.name] = val.count;
|
||||
} else if (typeof val === "object") {
|
||||
setMetrics(val, prefix + key + "-");
|
||||
} else if (prefix === "sysinfo-dns-replies-") {
|
||||
} else if (prefix === "sysinfo-dns-replies-" && data.sum !== 0) {
|
||||
// Compute and display percentage of DNS replies in addition to the absolute value
|
||||
const lval = val.toLocaleString();
|
||||
const percent = (100 * val) / data.sum;
|
||||
|
||||
Reference in New Issue
Block a user