Rename DNS cache efficiency -> utilization because this is more accurate

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2023-05-18 12:13:58 +02:00
parent 63697d8c19
commit fa37930066
2 changed files with 10 additions and 9 deletions

View File

@@ -132,7 +132,8 @@ function setMetrics(data, prefix) {
} else if (prefix === "sysinfo-dns-replies-") { } else if (prefix === "sysinfo-dns-replies-") {
// Compute and display percentage of DNS replies in addition to the absolute value // Compute and display percentage of DNS replies in addition to the absolute value
const lval = val.toLocaleString(); const lval = val.toLocaleString();
$("#" + prefix + key).text(lval + " (" + ((100 * val) / data.sum).toFixed(1) + "%)"); const percent = (100 * val) / data.sum;
$("#" + prefix + key).text(lval + " (" + percent.toFixed(1) + "%)");
} else { } else {
const lval = val.toLocaleString(); const lval = val.toLocaleString();
$("#" + prefix + key).text(lval); $("#" + prefix + key).text(lval);
@@ -161,7 +162,7 @@ function updateMetrics() {
// Set metrics // Set metrics
setMetrics(metrics, "sysinfo-"); setMetrics(metrics, "sysinfo-");
$("#cache-efficiency").text(((100 * cacheEntries) / cacheSize).toFixed(2) + "%"); $("#cache-utilization").text(((100 * cacheEntries) / cacheSize).toFixed(1) + "%");
$("div[id^='sysinfo-metrics-overlay']").hide(); $("div[id^='sysinfo-metrics-overlay']").hide();
// Update every 10 seconds // Update every 10 seconds

View File

@@ -170,37 +170,37 @@ mg.include('scripts/pi-hole/lua/header_authenticated.lp','r')
<tbody> <tbody>
<tr> <tr>
<th scope="row"> <th scope="row">
<span title="Size of the DNS domain cache">DNS cache size:</span> <span title="Total size of the DNS cache">DNS cache size:</span>
</th> </th>
<td id="sysinfo-dns-cache-size">&nbsp;</td> <td id="sysinfo-dns-cache-size">&nbsp;</td>
</tr> </tr>
<tr> <tr>
<th scope="row"> <th scope="row">
<span title="Percentage of the allocated cache that is currently in use. If this value is very low, it is advisable to reduce the DNS cache size to optimize performance">DNS cache efficiency:</span> <span title="Percentage of the allocated cache that is currently in use. If this value is very low, it is advisable to reduce the DNS cache size to optimize performance">DNS cache utilization:</span>
</th> </th>
<td id="cache-efficiency">&nbsp;</td> <td id="cache-utilization">&nbsp;</td>
</tr> </tr>
<tr> <tr>
<th scope="row"> <th scope="row">
<span title="Number of cache insertions">DNS cache insertions:</span> <span title="Number of cache insertions, this number will grow continuously as expiring records naturally make space for new records">DNS cache insertions:</span>
</th> </th>
<td id="sysinfo-dns-cache-inserted">&nbsp;</td> <td id="sysinfo-dns-cache-inserted">&nbsp;</td>
</tr> </tr>
<tr> <tr>
<th scope="row"> <th scope="row">
<span title="Number of cache entries that had to be removed although they are not expired (increase cache size to reduce this number)" lookatme-text="DNS cache evictions:">DNS cache evictions:</span> <span title="Number of cache entries that had to be removed although they are not expired. When this number if larger than zero, you should consider increasing your total cache size" lookatme-text="DNS cache evictions:">DNS cache evictions:</span>
</th> </th>
<td id="sysinfo-dns-cache-evicted">&nbsp;</td> <td id="sysinfo-dns-cache-evicted">&nbsp;</td>
</tr> </tr>
<tr> <tr>
<th scope="row"> <th scope="row">
DNS cache expiries: <span title="Number of cache entries that were removed because they expired">DNS cache expiries:</span>
</th> </th>
<td id="sysinfo-dns-cache-expired">&nbsp;</td> <td id="sysinfo-dns-cache-expired">&nbsp;</td>
</tr> </tr>
<tr> <tr>
<th scope="row"> <th scope="row">
Immortal DNS cache entries: <span title="Number of immortan cache entries that will never expire (e.g. from /etc/hosts or local configuration)">Immortal DNS cache entries:</span>
</th> </th>
<td id="sysinfo-dns-cache-immortal">&nbsp;</td> <td id="sysinfo-dns-cache-immortal">&nbsp;</td>
</tr> </tr>