@Test public void incDeltaFullValuesRequestedIncrementsDeltaFullValuesRequested() { cachePerfStats.incDeltaFullValuesRequested(); assertThat(statistics.getInt(deltaFullValuesRequestedId)).isEqualTo(1); }
@Before public void setUp() { StatisticsType statisticsType = CachePerfStats.getStatisticsType(); StatisticsManager statisticsManager = mock(StatisticsManager.class); StatisticsFactory statisticsFactory = mock(StatisticsFactory.class); Clock clock = mock(Clock.class); statistics = spy(new Atomic50StatisticsImpl(statisticsType, TEXT_ID, 1, 1, statisticsManager)); when(clock.getTime()).thenReturn(CLOCK_TIME); when(statisticsFactory.createAtomicStatistics(eq(statisticsType), eq(TEXT_ID))) .thenReturn(statistics); CachePerfStats.enableClockStats = true; cachePerfStats = new CachePerfStats(statisticsFactory, TEXT_ID, clock); }
/** * Characterization test: {@code cacheListenerCallsCompleted} currently wraps to negative from max * integer value. */ @Test public void cacheListenerCallsCompletedWrapsFromMaxIntegerToNegativeValue() { statistics.incInt(cacheListenerCallsCompletedId, Integer.MAX_VALUE); cachePerfStats.endCacheListenerCall(0); assertThat(cachePerfStats.getCacheListenerCallsCompleted()).isNegative(); }
public byte[] getDecompressedBytes(RegionEntryContext context) { byte[] result = getCompressedBytes(); long time = context.getCachePerfStats().startDecompression(); result = context.getCompressor().decompress(result); context.getCachePerfStats().endDecompression(time); return result; }
private void cacheWriteBeforeRegionClear(RegionEventImpl event) throws CacheWriterException, TimeoutException { // copy into local var to prevent race condition CacheWriter writer = basicGetWriter(); if (writer != null) { final long start = getCachePerfStats().startCacheWriterCall(); try { writer.beforeRegionClear(event); } finally { getCachePerfStats().endCacheWriterCall(start); } } serverRegionClear(event); }
/** * Characterization test: {@code deltasPrepared} currently wraps to negative from max * integer value. */ @Test public void deltasPreparedWrapsFromMaxIntegerToNegativeValue() { statistics.incInt(deltasPreparedId, Integer.MAX_VALUE); cachePerfStats.endDeltaPrepared(1); assertThat(cachePerfStats.getDeltasPrepared()).isNegative(); }
long giiStart = this.region.getCachePerfStats().startGetInitialImage(); InternalDistributedMember provider = null; Thread.currentThread().interrupt(); region.getCancelCriterion().checkCancelInProgress(ie); this.region.getCachePerfStats().endNoGIIDone(giiStart); return GIIStatus.NO_GII; this.region.getCachePerfStats().endGetInitialImage(giiStart); if (this.isDeltaGII) { this.region.getCachePerfStats().incDeltaGIICompleted(); this.region.getCachePerfStats().endNoGIIDone(giiStart);
private void processDeltaBytes(Object oldValueInVM) { if (!getRegion().hasSeenEvent(this)) { if (oldValueInVM == null || Token.isInvalidOrRemoved(oldValueInVM)) { getRegion().getCachePerfStats().incDeltaFailedUpdates(); throw new InvalidDeltaException("Old value not found for key " + this.keyInfo.getKey()); long start = CachePerfStats.getStatTime(); ((org.apache.geode.Delta) value) .fromDelta(new DataInputStream(new ByteArrayInputStream(getDeltaBytes()))); getRegion().getCachePerfStats().endDeltaUpdate(start); deltaBytesApplied = true; } catch (RuntimeException rte) { } finally { if (!deltaBytesApplied) { getRegion().getCachePerfStats().incDeltaFailedUpdates(); getRegion().getCachePerfStats().incDeltaFailedUpdates(); throw new InvalidDeltaException( "Cache encountered replay of event containing delta bytes for key "
/** * Characterization test: {@code deltaFullValuesRequested} currently wraps to negative from max * integer value. */ @Test public void deltaFullValuesRequestedWrapsFromMaxIntegerToNegativeValue() { statistics.incInt(deltaFullValuesRequestedId, Integer.MAX_VALUE); cachePerfStats.incDeltaFullValuesRequested(); assertThat(cachePerfStats.getDeltaFullValuesRequested()).isNegative(); } }
/** * override the one in LocalRegion since we don't need to do getDeserialized. */ @Override public Object get(Object key, Object aCallbackArgument, boolean generateCallbacks, boolean disableCopyOnRead, boolean preferCD, ClientProxyMembershipID requestingClient, EntryEventImpl clientEvent, boolean returnTombstones) throws TimeoutException, CacheLoaderException { validateKey(key); checkReadiness(); checkForNoAccess(); discoverJTA(); CachePerfStats stats = getCachePerfStats(); long start = stats.startGet(); boolean miss = true; try { // if scope is local and there is no loader, then // don't go further to try and get value Object value = getDataView().findObject(getKeyInfo(key, aCallbackArgument), this, true/* isCreate */, generateCallbacks, null /* no local value */, disableCopyOnRead, preferCD, requestingClient, clientEvent, returnTombstones); if (value != null && !Token.isInvalid(value)) { miss = false; } return value; } finally { stats.endGet(start, miss); } }
/** * Characterization test: {@code indexUpdateCompleted} currently wraps to negative from max * integer value. */ @Test public void indexUpdateCompletedWrapsFromMaxIntegerToNegativeValue() { statistics.incInt(indexUpdateCompletedId, Integer.MAX_VALUE); cachePerfStats.endIndexUpdate(1); assertThat(cachePerfStats.getIndexUpdateCompleted()).isNegative(); }
/** * Characterization test: {@code deltaUpdatesId} currently wraps to negative from max integer * value. */ @Test public void deltaUpdatesWrapsFromMaxIntegerToNegativeValue() { statistics.incInt(deltaUpdatesId, Integer.MAX_VALUE); cachePerfStats.endDeltaUpdate(1); assertThat(cachePerfStats.getDeltaUpdates()).isNegative(); }
/** * Characterization test: {@code cacheWriterCallsCompleted} currently wraps to negative from max * integer value. */ @Test public void cacheWriterCallsCompletedWrapsFromMaxIntegerToNegativeValue() { statistics.incInt(cacheWriterCallsCompletedId, Integer.MAX_VALUE); cachePerfStats.endCacheWriterCall(0); assertThat(cachePerfStats.getCacheWriterCallsCompleted()).isNegative(); }
/** * Characterization test: {@code getInitialImagesCompleted} currently wraps to negative from max * integer value. */ @Test public void getInitialImagesCompletedCallsCompletedWrapsFromMaxIntegerToNegativeValue() { statistics.incInt(getInitialImagesCompletedId, Integer.MAX_VALUE); cachePerfStats.endGetInitialImage(0); assertThat(cachePerfStats.getGetInitialImagesCompleted()).isNegative(); }
/** * Characterization test: Note that the only way to increment {@code misses} is to invoke * {@code endGet}. */ @Test public void endGetIncrementsMisses() { cachePerfStats.endGet(0, true); assertThat(statistics.getInt(missesId)).isEqualTo(1); }
@Override public CachePerfStats getCachePerfStats() { return new CachePerfStats(cache.getDistributedSystem(), META_DATA_REGION_NAME); } };
final long startPA = getCachePerfStats().startIndexUpdate(); Boolean initialPdxReadSerialized = this.cache.getPdxReadSerializedOverride(); this.cache.setPdxReadSerializedOverride(true); ((TXManagerImpl) this.cache.getCacheTransactionManager()).unpauseTransaction(tx); getCachePerfStats().endIndexUpdate(startPA);
final long start = getCachePerfStats().startCacheListenerCall(); getCachePerfStats().endCacheListenerCall(start); if (isOriginRemoteSetOnEvent) { ((EntryEventImpl) event).setOriginRemote(isOriginRemote);