Commit b20b514
fix bug in printing eviction success rate
Summary:
This change fixes below bug printing wrong eviction success rate.
Evict Attempts: 439,372 Success: -4198434145486952.50%
RAM Evictions : 618,369
This happens because of the overflow in below code https://fburl.com/code/ln24ozv0
```
out << folly::sformat(
"Evict Attempts: {:,} Success: {:.2f}%",
evictAttempts,
invertPctFn(evictAttempts - numEvictions, evictAttempts)
```
Again, this could happen because evictAttempts and numEvictions are not taken atomically
https://fburl.com/code/i587dhfh
Reviewed By: therealgymmy
Differential Revision: D46043428
fbshipit-source-id: 022a07e09c1093ca705e9e57596fa912497ba32d1 parent ad0b378 commit b20b514
1 file changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
125 | 124 | | |
126 | 125 | | |
127 | 126 | | |
| |||
0 commit comments