Skip to content

Commit 185c373

Browse files
committed
Update hit rate calculation in performance metrics for improved accuracy
- Changed the method used to convert hit rate from `as_f` to `to_f64`, ensuring better precision in health score calculations based on cache statistics.
1 parent f952d64 commit 185c373

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/performance/performance_metrics.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ module CQL::Performance
701701

702702
# Calculate health score based on cache statistics
703703
cache_stats = cache.stats
704-
hit_rate = cache_stats["hit_rate"]?.try(&.as_f) || 0.0
704+
hit_rate = cache_stats["hit_rate"]?.try(&.to_f64) || 0.0
705705

706706
# Base score of 100, penalize for low hit rates
707707
if hit_rate >= 80.0

0 commit comments

Comments
 (0)