-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The stats ticker does not use the builder's ticker. #240
Comments
NB I expect this to pass:
Currently it throws
|
Thanks! I see that the cause is due refreshIfNeeded using the
Guava does not use the configured ticker in its stats recording and I don't see a good reason to for users to configure it. So my preference would be (1). Any objections? Reviewing the usages, all others are correctly using the |
There's a few items on the backlog, but I'll try to wrap them up and release this weekend. |
Released 2.7 |
Building a cache loader that uses both stats and expiration (eg recordStats and expireAfterWrite) and providing a ticker for testing builds a cache that uses system time for stats and the provided ticker for expiration.
This can become a problem because the CacheStats constructor validates that variables are not negative, which they can become if the stubbed ticker's time is in the future (or more than System.nanoTime), in general it's possible to test refresh by ensuring that
start time + refresh time
is never more thanSystem.nanoTime
, but when the computer is restarted (On my linux desktop the jvm seems to use time since startup) tests can not be made to pass until the uptime is more than the refresh time.The text was updated successfully, but these errors were encountered: