code: private void updateStats() {
          EhcacheStats stats = getProducerStats();
          Statistics statistics = underlyingCache.getStatistics();
          double accesses = statistics.getCacheHits() + statistics.getCacheMisses();
          double hitRatio = accesses != 0 ? statistics.getCacheHits() / accesses : 0;
  
          stats.getStatisticsAccuracy().setValueAsString(statistics.getStatisticsAccuracyDescription());
          stats.getHitRatio().setValueAsDouble(hitRatio);
          stats.getHits().setValueAsLong(statistics.getCacheHits());
          stats.getMisses().setValueAsLong(statistics.getCacheMisses());
          stats.getElements().setValueAsLong(statistics.getObjectCount());
  
          stats.getInMemoryHits().setValueAsLong(statistics.getInMemoryHits());
          stats.getInMemoryMisses().setValueAsLong(statistics.getInMemoryMisses());
          stats.getInMemoryElements().setValueAsLong(statistics.getMemoryStoreObjectCount());
  
          stats.getOnDiskHits().setValueAsLong(statistics.getOnDiskHits());
          stats.getOnDiskMisses().setValueAsLong(statistics.getOnDiskMisses());
          stats.getOnDiskElements().setValueAsLong(statistics.getDiskStoreObjectCount());
  
          stats.getOffHeapHits().setValueAsLong(statistics.getOffHeapHits());
          stats.getOffHeapMisses().setValueAsLong(statistics.getOffHeapMisses());
          stats.getOffHeapElements().setValueAsLong(statistics.getOffHeapStoreObjectCount());
  
          stats.getAverageGetTime().setValueAsDouble(statistics.getAverageGetTime());
          stats.getAverageSearchTime().setValueAsLong(statistics.getAverageSearchTime());
  
          stats.getSearchesPerSecond().setValueAsLong(statistics.getSearchesPerSecond());
          stats.getEvictionCount().setValueAsLong(statistics.getEvictionCount());
          stats.getWriterQueueLength().setValueAsLong(statistics.getWriterQueueSize());
      }
docs: Updates internal producer's stats using Ehcache statistics.