Skip to content

Commit ae6eed6

Browse files
committed
Update RedisTrait.php
1 parent f55665a commit ae6eed6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Dashboards/Redis/RedisTrait.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ private function panels(): string {
5050
$used_memory_formatted = ['Used', Format::bytes($used_memory)];
5151
}
5252

53-
$hits = $info['stats']['keyspace_hits'];
54-
$misses = $info['stats']['keyspace_misses'];
55-
$hit_rate = $hits !== 0 ? round(($hits / ($hits + $misses)) * 100, 2) : 0;
53+
$hits = (int) $info['stats']['keyspace_hits'];
54+
$misses = (int) $info['stats']['keyspace_misses'];
55+
$total = $hits + $misses;
56+
$hit_rate = $total !== 0 ? round(($hits / $total) * 100, 2) : 0;
5657

5758
$panels = [
5859
[

0 commit comments

Comments
 (0)