/** {@inheritDoc} */ @Override public long getEntryProcessorInvocations() { return cache.clusterMetrics().getEntryProcessorInvocations(); }
/** * Checks no metrics changed in cache. * * @param jcache Cache to be checked. */ private void assertNoMetricsChanged(IgniteCache<Object, Object> jcache) { assertEquals(0, jcache.localMetrics().getEntryProcessorPuts()); assertEquals(0, jcache.localMetrics().getEntryProcessorRemovals()); assertEquals(0, jcache.localMetrics().getEntryProcessorReadOnlyInvocations()); assertEquals(0, jcache.localMetrics().getEntryProcessorInvocations()); assertEquals(0, jcache.localMetrics().getEntryProcessorMisses()); assertEquals(0, jcache.localMetrics().getEntryProcessorHits()); assertEquals(0, jcache.localMetrics().getEntryProcessorMissPercentage(), 0.001f); assertEquals(0, jcache.localMetrics().getEntryProcessorHitPercentage(), 0.001f); }
assertEquals(1, jcache.localMetrics().getEntryProcessorRemovals()); assertEquals(1, jcache.localMetrics().getEntryProcessorReadOnlyInvocations()); assertEquals(2, jcache.localMetrics().getEntryProcessorInvocations()); assertEquals(1, jcache.localMetrics().getEntryProcessorRemovals()); assertEquals(0, jcache.localMetrics().getEntryProcessorReadOnlyInvocations()); assertEquals(1, jcache.localMetrics().getEntryProcessorInvocations()); assertEquals(1, jcache.localMetrics().getEntryProcessorRemovals()); assertEquals(0, jcache.localMetrics().getEntryProcessorReadOnlyInvocations()); assertEquals(1, jcache.localMetrics().getEntryProcessorInvocations());
assertEquals(1, jcache.localMetrics().getEntryProcessorRemovals()); assertEquals(2, jcache.localMetrics().getEntryProcessorInvocations()); assertEquals(1, jcache.localMetrics().getEntryProcessorInvocations());
assertEquals(1, jcache.localMetrics().getEntryProcessorRemovals()); assertEquals(1, jcache.localMetrics().getEntryProcessorReadOnlyInvocations()); assertEquals(2, jcache.localMetrics().getEntryProcessorInvocations()); assertEquals(1, jcache.localMetrics().getEntryProcessorRemovals()); assertEquals(0, jcache.localMetrics().getEntryProcessorReadOnlyInvocations()); assertEquals(1, jcache.localMetrics().getEntryProcessorInvocations());
assertEquals(2, cache0.localMetrics().getEntryProcessorInvocations());
/** * @param emptyCache Empty cache. * @throws IgniteCheckedException If failed. */ private void testReadOnlyInvocations(final boolean emptyCache) throws IgniteCheckedException { IgniteCache<Integer, Integer> cache0 = grid(0).cache(DEFAULT_CACHE_NAME); final Integer key = primaryKey(jcache(0)); if (emptyCache) cache0.remove(key); else cache0.put(key, 0); cache0.invoke(key, readingProcessor); assertEquals(1, cache0.localMetrics().getEntryProcessorReadOnlyInvocations()); if (emptyCache) { assertEquals(1, cache0.localMetrics().getEntryProcessorMisses()); assertEquals(100f, cache0.localMetrics().getEntryProcessorMissPercentage()); assertEquals(0f, cache0.localMetrics().getEntryProcessorHitPercentage()); } else { assertEquals(1, cache0.localMetrics().getEntryProcessorHits()); assertEquals(0f, cache0.localMetrics().getEntryProcessorMissPercentage()); assertEquals(100f, cache0.localMetrics().getEntryProcessorHitPercentage()); } for (int i = 1; i < gridCount(); i++) assertEquals(0, jcache(i).localMetrics().getEntryProcessorReadOnlyInvocations()); assertEquals(1, cache0.localMetrics().getEntryProcessorInvocations()); }
assertEquals(1, jcache.localMetrics().getEntryProcessorReadOnlyInvocations()); assertEquals(1, jcache.localMetrics().getEntryProcessorRemovals()); assertEquals(3, jcache.localMetrics().getEntryProcessorInvocations()); assertEquals(0, jcache.localMetrics().getEntryProcessorReadOnlyInvocations()); assertEquals(1, jcache.localMetrics().getEntryProcessorRemovals()); assertEquals(2, jcache.localMetrics().getEntryProcessorInvocations());
/** * @throws IgniteCheckedException If failed. */ private void testUpdateInvocations(final boolean emptyCache) throws IgniteCheckedException { IgniteCache<Integer, Integer> cache0 = grid(0).cache(DEFAULT_CACHE_NAME); final Integer key = primaryKey(jcache(0)); if (emptyCache) cache0.remove(key); else cache0.put(key, 0); cache0.invoke(key, updatingProcessor); assertEquals(1, cache0.localMetrics().getEntryProcessorPuts()); if (emptyCache) { assertEquals(1, cache0.localMetrics().getEntryProcessorMisses()); assertEquals(100f, cache0.localMetrics().getEntryProcessorMissPercentage()); assertEquals(0f, cache0.localMetrics().getEntryProcessorHitPercentage()); } else { assertEquals(1, cache0.localMetrics().getEntryProcessorHits()); assertEquals(0f, cache0.localMetrics().getEntryProcessorMissPercentage()); assertEquals(100f, cache0.localMetrics().getEntryProcessorHitPercentage()); } for (int i = 1; i < gridCount(); i++) { Ignite ignite = ignite(i); IgniteCache<Integer, Integer> cache = ignite.cache(DEFAULT_CACHE_NAME); if (affinity(cache).isPrimaryOrBackup(ignite.cluster().localNode(), key)) assertEquals(1, cache.localMetrics().getEntryProcessorPuts()); } assertEquals(1, cache0.localMetrics().getEntryProcessorInvocations()); }
assertEquals(1, jcache.localMetrics().getEntryProcessorRemovals()); assertEquals(1, jcache.localMetrics().getEntryProcessorReadOnlyInvocations()); assertEquals(3, jcache.localMetrics().getEntryProcessorInvocations()); assertEquals(1, jcache.localMetrics().getEntryProcessorRemovals()); assertEquals(0, jcache.localMetrics().getEntryProcessorReadOnlyInvocations()); assertEquals(2, jcache.localMetrics().getEntryProcessorInvocations());
entryProcessorInvocations = e.getEntryProcessorInvocations(); entryProcessorRemovals = e.getEntryProcessorRemovals(); entryProcessorMisses = e.getEntryProcessorMisses();
assertEquals(1, jcache.localMetrics().getEntryProcessorRemovals()); assertEquals(1, jcache.localMetrics().getEntryProcessorReadOnlyInvocations()); assertEquals(3, jcache.localMetrics().getEntryProcessorInvocations()); assertEquals(1, jcache.localMetrics().getEntryProcessorRemovals()); assertEquals(0, jcache.localMetrics().getEntryProcessorReadOnlyInvocations()); assertEquals(2, jcache.localMetrics().getEntryProcessorInvocations());
entryProcessorInvocations = e.getEntryProcessorInvocations(); entryProcessorRemovals = e.getEntryProcessorRemovals(); entryProcessorMisses = e.getEntryProcessorMisses();
assertEquals(m.getEntryProcessorMaxInvocationTime(), 0f); assertEquals(m.getEntryProcessorAverageInvocationTime(), 0f); assertEquals(m.getEntryProcessorInvocations(), 0);
/** {@inheritDoc} */ @Override public long getEntryProcessorInvocations() { return cache.clusterMetrics().getEntryProcessorInvocations(); }
writer.writeLong(metrics.getEntryProcessorPuts()); writer.writeFloat(metrics.getEntryProcessorAverageInvocationTime()); writer.writeLong(metrics.getEntryProcessorInvocations()); writer.writeFloat(metrics.getEntryProcessorMaxInvocationTime()); writer.writeFloat(metrics.getEntryProcessorMinInvocationTime());
entryProcessorInvocations = e.getEntryProcessorInvocations(); entryProcessorRemovals = e.getEntryProcessorRemovals(); entryProcessorMisses = e.getEntryProcessorMisses();
writer.writeLong(metrics.getEntryProcessorPuts()); writer.writeFloat(metrics.getEntryProcessorAverageInvocationTime()); writer.writeLong(metrics.getEntryProcessorInvocations()); writer.writeFloat(metrics.getEntryProcessorMaxInvocationTime()); writer.writeFloat(metrics.getEntryProcessorMinInvocationTime());