Skip to content

Commit 8611512

Browse files
committed
Fix cache hit display
1 parent 88632e7 commit 8611512

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dnscrypt-proxy/monitoring_ui.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,11 +593,11 @@ func (mc *MetricsCollector) GetMetrics() map[string]interface{} {
593593
avgResponseTime = float64(responseTimeSum) / float64(responseTimeCount)
594594
}
595595

596-
// Calculate cache hit ratio
596+
// Calculate cache hit ratio (as decimal 0-1, not percentage)
597597
var cacheHitRatio float64
598598
totalCacheQueries := cacheHits + cacheMisses
599599
if totalCacheQueries > 0 {
600-
cacheHitRatio = float64(cacheHits) / float64(totalCacheQueries) * 100
600+
cacheHitRatio = float64(cacheHits) / float64(totalCacheQueries)
601601
}
602602

603603
// Calculate per-server metrics sorted by increasing average response time

0 commit comments

Comments
 (0)