Examples of CacheStatistics


Examples of com.hazelcast.cache.CacheStatistics

        if (cacheServiceEnabled) {
            final ICacheService cacheService = getCacheService();
            for (CacheConfig cacheConfig : cacheService.getCacheConfigs()) {
                if (cacheConfig.isStatisticsEnabled()) {
                    CacheStatistics statistics = cacheService.getStatistics(cacheConfig.getNameWithPrefix());
                    count = handleCache(memberState, count, cacheConfig, statistics);
                }
            }
        }
    }
View Full Code Here

Examples of javax.cache.CacheStatistics

            throw new IllegalArgumentException("Illegal stats args: " + execute);

        String name = split[0];
        Cache cache = cacheConfig.findCache(name);
        if (cache != null) {
            CacheStatistics stats = cache.getCacheStatistics();
            String op = split[1];
            Method m = CacheStatistics.class.getMethod(op);
            display(op, m.invoke(stats));
        } else {
            display("", "No such cache:" + name);
View Full Code Here

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

Examples of net.sf.jsr107cache.CacheStatistics

     * 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

Examples of net.sf.jsr107cache.CacheStatistics

        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

Examples of org.apache.archiva.redback.components.cache.CacheStatistics

                }
            }
        }

        // Test the statistics.
        CacheStatistics stats = cache.getStatistics();

        int expectedHits = ( ( ( HIGH - LOW - removedKeys.size() ) * ITERS ) + DIRECT );
        int expectedMiss = ( ITERS * removedKeys.size() );

        /* Due to the nature of how the various providers do their work, the expected values
         * should be viewed as minimum values, not exact values.
         */
        assertTrue( "Cache hit count should exceed [" + expectedHits + "], but was actually [" + stats.getCacheHits()
            + "]", expectedHits <= stats.getCacheHits() );

        assertTrue( "Cache miss count should exceed [" + expectedMiss + "], but was actually [" + stats.getCacheMiss()
            + "]", expectedMiss <= stats.getCacheMiss() );

        /* For the same reason as above, the hit rate is completely un-testable.
         * Leaving this commented so that future developers understand the reason we are not
         * testing this value.
        
View Full Code Here

Examples of org.apache.archiva.redback.components.cache.CacheStatistics

        List<CacheEntry> cacheEntries = new ArrayList<CacheEntry>( caches.size() );
        DecimalFormat decimalFormat = new DecimalFormat( "#%" );

        for ( Map.Entry<String, Cache> entry : caches.entrySet() )
        {
            CacheStatistics cacheStatistics = entry.getValue().getStatistics();

            cacheEntries.add( new CacheEntry( entry.getKey(), cacheStatistics.getSize(), cacheStatistics.getCacheHits(),
                                              cacheStatistics.getCacheMiss(),
                                              decimalFormat.format( cacheStatistics.getCacheHitRate() ).toString(),
                                              cacheStatistics.getInMemorySize() ) );
        }

        Collections.sort( cacheEntries );

        return cacheEntries;
View Full Code Here

Examples of org.apache.archiva.redback.components.cache.CacheStatistics

        List<CacheEntry> cacheEntries = new ArrayList<CacheEntry>( caches.size() );
        DecimalFormat decimalFormat = new DecimalFormat( "#%" );

        for ( Map.Entry<String, Cache> entry : caches.entrySet() )
        {
            CacheStatistics cacheStatistics = entry.getValue().getStatistics();

            cacheEntries.add( new CacheEntry( entry.getKey(), cacheStatistics.getSize(), cacheStatistics.getCacheHits(),
                                              cacheStatistics.getCacheMiss(),
                                              decimalFormat.format( cacheStatistics.getCacheHitRate() ).toString(),
                                              cacheStatistics.getInMemorySize() ) );
        }

        Collections.sort( cacheEntries );

        return cacheEntries;
View Full Code Here

Examples of org.apache.archiva.redback.components.cache.CacheStatistics

        List<CacheEntry> cacheEntries = new ArrayList<CacheEntry>( caches.size() );
        DecimalFormat decimalFormat = new DecimalFormat( "#%" );

        for ( Map.Entry<String, Cache> entry : caches.entrySet() )
        {
            CacheStatistics cacheStatistics = entry.getValue().getStatistics();

            cacheEntries.add( new CacheEntry( entry.getKey(), cacheStatistics.getSize(), cacheStatistics.getCacheHits(),
                                              cacheStatistics.getCacheMiss(),
                                              decimalFormat.format( cacheStatistics.getCacheHitRate() ).toString(),
                                              cacheStatistics.getInMemorySize() ) );
        }

        return cacheEntries;
    }
View Full Code Here

Examples of org.apache.openjpa.datacache.CacheStatistics

    public void setContextRef(String cref) {
        _configRef = cref;
    }

    public long getHitCount() {
        CacheStatistics stats = getStatistics();
        if (stats != null)
            return stats.getHitCount();
        return NO_STATS;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.