Package net.sf.ehcache.statistics

Examples of net.sf.ehcache.statistics.LiveCacheStatistics


        sb.append("     Idle: ........................ ").append(DatabaseFactory.getInstance().getIdleConnectionCount()).append('\n');
        sb.append("Players").append('\n');
        sb.append("     Update: ...................... ").append(GameStats.getUpdatePlayerBase()).append('\n');
        double cacheHitCount, cacheMissCount, cacheHitRatio;
        Cache cache;
        LiveCacheStatistics cacheStats;
        JdbcEntityStats entityStats;
        cache = ItemsDAO.getInstance().getCache();
        cacheStats = cache.getLiveCacheStatistics();
        entityStats = ItemsDAO.getInstance().getStats();
        cacheHitCount = cacheStats.getCacheHitCount();
        cacheMissCount = cacheStats.getCacheMissCount();
        cacheHitRatio = cacheHitCount / (cacheHitCount + cacheMissCount);
        sb.append("Items").append('\n');
        sb.append("     getLoadCount: ................ ").append(entityStats.getLoadCount()).append('\n');
        sb.append("     getInsertCount: .............. ").append(entityStats.getInsertCount()).append('\n');
        sb.append("     getUpdateCount: .............. ").append(entityStats.getUpdateCount()).append('\n');
        sb.append("     getDeleteCount: .............. ").append(entityStats.getDeleteCount()).append('\n');
        sb.append("Cache").append('\n');
        sb.append("     getPutCount: ................. ").append(cacheStats.getPutCount()).append('\n');
        sb.append("     getUpdateCount: .............. ").append(cacheStats.getUpdateCount()).append('\n');
        sb.append("     getRemovedCount: ............. ").append(cacheStats.getRemovedCount()).append('\n');
        sb.append("     getEvictedCount: ............. ").append(cacheStats.getEvictedCount()).append('\n');
        sb.append("     getExpiredCount: ............. ").append(cacheStats.getExpiredCount()).append('\n');
        sb.append("     getSize: ..................... ").append(cacheStats.getSize()).append('\n');
        sb.append("     getLocalHeapSize: ............. ").append(cacheStats.getLocalHeapSize()).append('\n');
        sb.append("     getLocalDiskSize: ............... ").append(cacheStats.getLocalDiskSize()).append('\n');
        sb.append("     cacheHitRatio: ............... ").append(String.format("%2.2f", cacheHitRatio)).append('\n');
        sb.append("=================================================\n");
        cache = MailDAO.getInstance().getCache();
        cacheStats = cache.getLiveCacheStatistics();
        entityStats = MailDAO.getInstance().getStats();
        cacheHitCount = cacheStats.getCacheHitCount();
        cacheMissCount = cacheStats.getCacheMissCount();
        cacheHitRatio = cacheHitCount / (cacheHitCount + cacheMissCount);
        sb.append("Mail").append('\n');
        sb.append("     getLoadCount: ................ ").append(entityStats.getLoadCount()).append('\n');
        sb.append("     getInsertCount: .............. ").append(entityStats.getInsertCount()).append('\n');
        sb.append("     getUpdateCount: .............. ").append(entityStats.getUpdateCount()).append('\n');
        sb.append("     getDeleteCount: .............. ").append(entityStats.getDeleteCount()).append('\n');
        sb.append("Cache").append('\n');
        sb.append("     getPutCount: ................. ").append(cacheStats.getPutCount()).append('\n');
        sb.append("     getUpdateCount: .............. ").append(cacheStats.getUpdateCount()).append('\n');
        sb.append("     getRemovedCount: ............. ").append(cacheStats.getRemovedCount()).append('\n');
        sb.append("     getEvictedCount: ............. ").append(cacheStats.getEvictedCount()).append('\n');
        sb.append("     getExpiredCount: ............. ").append(cacheStats.getExpiredCount()).append('\n');
        sb.append("     getSize: ..................... ").append(cacheStats.getSize()).append('\n');
        sb.append("     getLocalHeapSize: ............. ").append(cacheStats.getLocalHeapSize()).append('\n');
        sb.append("     getLocalDiskSize: ............... ").append(cacheStats.getLocalDiskSize()).append('\n');
        sb.append("     cacheHitRatio: ............... ").append(String.format("%2.2f", cacheHitRatio)).append('\n');
        sb.append("=================================================\n");
        return sb.toString();
      }
    });
View Full Code Here


    public long getWriterQueueLength() {
        long result = 0;
        for (String cacheName : getCacheNames()) {
            Ehcache cache = cacheManager.getEhcache(cacheName);
            if (cache != null) {
                LiveCacheStatistics stats = cache.getLiveCacheStatistics();
                result += Math.max(stats.getWriterQueueLength(), 0);
            }
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of net.sf.ehcache.statistics.LiveCacheStatistics

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.