Jens Schauder
Jens Schauder

Reputation: 81990

Documentation of the ehcache statistics API in 2.8.x

Somewhere between 2.6.x and 2.8.x ehcache seems to have completely changed their statistics API.

Is there any documentation available for this change?

A little background

I'm trying to migrate metrics ehcache instrumentation to ehcache 2.8.3, which basically means fixing this class.

I think I managed to guess many of the changes, but I'm totally lost how to replace the following calls in 2.8.x

cache.setSampledStatisticsEnabled(true);
cache.setStatisticsAccuracy(Statistics.STATISTICS_ACCURACY_NONE);
cache.getStatistics().getStatisticsAccuracyDescription();

Upvotes: 3

Views: 326

Answers (1)

Chris Dennis
Chris Dennis

Reputation: 476

Those methods don't have equivalents in the new statistics API. They would map to no-ops. The new statistics API turns on statistics as you access them. There isn't really any explicit enable or disable. If you stop using a statistic it gets disabled after a user configurable time (Time-To-Disable). All statistics are accurate, and the more statistics you use (or the more complicated the statistics) the more overhead you get. Hope that makes sense!

[Source: I'm the co-author of the new statistics api/impl]

Upvotes: 2

Related Questions