Statistics of parsing and cache usage #1949
-
|
Is there a way to access statistics on the number of executed parsings and cache usage — including how many entries were used and how many parses were avoided due to cache hits? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
The default implementation does not expose this. NOTE: The caching for the useragents and for the clienthints is separate, so you'll have 2 of these! Create new classes similar this and this Instead of immediately returning the instance you can keep a reference to the instance and expose the statistics you need. This also allows you to choose any caching implementation you like. |
Beta Was this translation helpful? Give feedback.
The default implementation does not expose this.
The solution is quite simple because you can easily override the caching implementation (so you can take full control).
NOTE: The caching for the useragents and for the clienthints is separate, so you'll have 2 of these!
Create new classes similar this
yauaa/analyzer/src/main/java/nl/basjes/parse/useragent/cache/Java11CacheInstantiator.java
Lines 25 to 29 in 6e97063