Issue 118

Goal: exposing statistics result

Method: the gathering process is adapted from Ehcache 2 code base. It's simplified to expose just what JSR107 needed.

Concerns:
  1. Clearing stats: needs to find a way to clear all the stats

  2. Average time spent in gets/puts: was told by Chris it's doable with mean latency from stats module but I have found no example of how to wire it up

  3. Old CacheManager will provide a shared instance of ScheduledExecutorService to every cache for stats gathering. This model isn't the same in Ehcache3 since we have EhcacheManager and StandaloneCacheBuilder both creating an Ehcache instance. I've ended up creating the executor in both of these places for now. Also, to avoid an NPE from initiating a statistics gateway in other tests in which Ehcache instance is created from constructor, a default executor is being used (see Ehcache.java line 103). This is just a hack to get the tests running. It's definitely needed revised.

  4. Testing: testing statistics required a real Ehcache usage with OnheapStore backing. It doesn't seem it could be done inside "core" module since it's missing OnheapStore from the "impl" module. I had to place my statistics test in "impl" as a result. The test is still in progress.


This is really weird... it's going to mess up the get latency numbers too.  I'm not sure what we can do about it though.  Maybe we can have a PutIfAbsentOutcome type, and then have the JSR-107 get counts sum up the counts of all the independent operation outcomes as per the table.