Package net.sf.jsr107cache

Examples of net.sf.jsr107cache.CacheStatistics


     * Method to get the cache hit rate.
     *
     * @return the cache hit rate.
     */
    public double hitRate() {
        CacheStatistics stats = this.cache.getCacheStatistics();
        return (double) stats.getCacheHits() /
                ((double) (stats.getCacheHits() + stats.getCacheMisses()));
    }
View Full Code Here


     * Method to get the cache hit rate.
     *
     * @return the cache hit rate.
     */
    public double hitRate() {
        CacheStatistics stats = pathCache.getCacheStatistics();
        return (double) stats.getCacheHits() /
                ((double) (stats.getCacheHits() + stats.getCacheMisses()));
    }
View Full Code Here

        cache.remove(id);
    }

    public static void printStatistics(Cache cache) {
        CacheStatistics stats = cache.getCacheStatistics();

        System.out.println("Objects in cache: " + stats.getObjectCount());
        System.out.println("Cache hits: " + stats.getCacheHits());
        System.out.println("Cache misses: " + stats.getCacheMisses());
    }
View Full Code Here

TOP

Related Classes of net.sf.jsr107cache.CacheStatistics

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.