/** {@inheritDoc} */ @Override public long getCacheEvictions() { return cache.clusterMetrics().getCacheEvictions(); }
/** * @throws Exception If failed. */ @Test public void testEntryProcessorRemove() throws Exception { IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME); cache.put(1, 20); int result = cache.invoke(1, new EntryProcessor<Integer, Integer, Integer>() { @Override public Integer process(MutableEntry<Integer, Integer> entry, Object... arguments) throws EntryProcessorException { Integer result = entry.getValue(); entry.remove(); return result; } }); assertEquals(1L, cache.localMetrics().getCachePuts()); assertEquals(20, result); assertEquals(1L, cache.localMetrics().getCacheHits()); assertEquals(100.0f, cache.localMetrics().getCacheHitPercentage()); assertEquals(0L, cache.localMetrics().getCacheMisses()); assertEquals(0f, cache.localMetrics().getCacheMissPercentage()); assertEquals(1L, cache.localMetrics().getCachePuts()); assertEquals(1L, cache.localMetrics().getCacheRemovals()); assertEquals(0L, cache.localMetrics().getCacheEvictions()); assert cache.localMetrics().getAveragePutTime() >= 0; assert cache.localMetrics().getAverageGetTime() >= 0; assert cache.localMetrics().getAverageRemoveTime() >= 0; }
/** * @throws Exception If failed. */ @Test public void testEntryProcessorRemove() throws Exception { IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME); cache.put(1, 20); int result = cache.invoke(1, new EntryProcessor<Integer, Integer, Integer>() { @Override public Integer process(MutableEntry<Integer, Integer> entry, Object... arguments) throws EntryProcessorException { Integer result = entry.getValue(); entry.remove(); return result; } }); assertEquals(1L, cache.localMetrics().getCachePuts()); assertEquals(20, result); assertEquals(1L, cache.localMetrics().getCacheHits()); assertEquals(100.0f, cache.localMetrics().getCacheHitPercentage()); assertEquals(0L, cache.localMetrics().getCacheMisses()); assertEquals(0f, cache.localMetrics().getCacheMissPercentage()); assertEquals(1L, cache.localMetrics().getCachePuts()); assertEquals(1L, cache.localMetrics().getCacheRemovals()); assertEquals(0L, cache.localMetrics().getCacheEvictions()); assert cache.localMetrics().getAveragePutTime() >= 0; assert cache.localMetrics().getAverageGetTime() >= 0; assert cache.localMetrics().getAverageRemoveTime() >= 0; }
evictions = m.getCacheEvictions();
txCommits += e.getCacheTxCommits(); txRollbacks += e.getCacheTxRollbacks(); evicts += e.getCacheEvictions(); removes += e.getCacheRemovals();
txCommits += e.getCacheTxCommits(); txRollbacks += e.getCacheTxRollbacks(); evicts += e.getCacheEvictions(); removes += e.getCacheRemovals();
/** {@inheritDoc} */ @Override public long getCacheEvictions() { return cache.clusterMetrics().getCacheEvictions(); }
writer.writeLong(metrics.getCachePuts()); writer.writeLong(metrics.getCacheRemovals()); writer.writeLong(metrics.getCacheEvictions()); writer.writeFloat(metrics.getAverageGetTime()); writer.writeFloat(metrics.getAveragePutTime());
evictions = m.getCacheEvictions();
txCommits += e.getCacheTxCommits(); txRollbacks += e.getCacheTxRollbacks(); evicts += e.getCacheEvictions(); removes += e.getCacheRemovals();
writer.writeLong(metrics.getCachePuts()); writer.writeLong(metrics.getCacheRemovals()); writer.writeLong(metrics.getCacheEvictions()); writer.writeFloat(metrics.getAverageGetTime()); writer.writeFloat(metrics.getAveragePutTime());