@Override public Object executeFunction(boolean enableStreaming, boolean isPossibleDuplicate, AbstractGemFireResultSet rs, boolean orderedReplies, boolean getResult) throws StandardException, SQLException { // overridden for stats final CachePerfStats stats = this.region.getCachePerfStats(); final long start = stats.startGet(); Object result = null; try { result = super.executeFunction(enableStreaming, isPossibleDuplicate, rs, orderedReplies, getResult); } finally { // Fixes for Issue #48947 // If a SQL select on a PR table with primary key lookup is done it goes // by GetExecutorMessage to peer members. // As this message bypasses the Region.get() API and directly access // InternalDataView.getLocally() the "gets" stats are not getting updated. // We need to update the stats from outside to show correct stats. if (this.pr != null) { this.pr.prStats.endGet(start); } stats.endGet(start, result == null); } return result; }
/** * @return the timestamp that marks the start of the operation */ public long startGet() { return getStatTime(); } /**
public CachePerfStats getCachePerfStats() { return new CachePerfStats(cache.getDistributedSystem(), META_DATA_REGION_NAME); } };
public final void putAll(Map map) { long startPut = CachePerfStats.getStatTime(); final DistributedPutAllOperation putAllOp = newPutAllOperation(map); if (putAllOp != null) { //Because Gemfirexd directly calls basicPutAll, the offheap resources freeing is // done in the function basicPutAll basicPutAll(map, putAllOp, null); } getCachePerfStats().endPutAll(startPut); }
public void testTimeBasedCounters() throws InterruptedException { final long startTime = CachePerfStats.getStatTime(); cachePerfStats.startCacheListenerCall(); cachePerfStats.startCacheWriterCall(); partitionedRegionStats.startPutRemote(); sample(); cachePerfStats.endCacheListenerCall(startTime); cachePerfStats.endCacheWriterCall(startTime); partitionedRegionStats.endPutRemote(startTime); sample(); assertTrue(getCacheListenerCallsAvgLatency() > 0); assertTrue(getCacheWriterCallsAvgLatency() > 0); assertTrue(getPutRemoteLatency() > 0); }
public void testTimeBasedCounters() throws InterruptedException { long startGIITime = cachePerfStats.startGetInitialImage(); long startCacheListenerTime = cachePerfStats.startCacheListenerCall(); long startCacheWriterTime = cachePerfStats.startCacheWriterCall(); long startLoadTime = cachePerfStats.startLoad(); cachePerfStats.endPutAll(testStartTime); long startGetsTime1 = cachePerfStats.startGet(); long startGetsTime2 = cachePerfStats.startGet(); long startNetLoadTime = cachePerfStats.startNetload(); long startNetSearchTime = cachePerfStats.startNetsearch(); cachePerfStats.endGetInitialImage(startGIITime); cachePerfStats.endCacheListenerCall(startCacheListenerTime); cachePerfStats.endCacheWriterCall(startCacheWriterTime); cachePerfStats.endGet(startGetsTime1, true); cachePerfStats.endGet(startGetsTime2, false); cachePerfStats.endLoad(startLoadTime); cachePerfStats.endNetload(startNetLoadTime); cachePerfStats.endNetsearch(startNetSearchTime); long startPutsTime = cachePerfStats.endPut(testStartTime, false); cachePerfStats.txSuccess(CachePerfStats.getStatTime() - testStartTime, testStartTime, 1); cachePerfStats.txRollback(CachePerfStats.getStatTime() - testStartTime, testStartTime, 1);
long startEvictionTime = stats.startCustomEviction(); int evicted = 0; long startEvaluationTime = stats.startEvaluation(); Iterator<Entry<Object, Object>> keysItr = null; long totalIterationsTime = 0; .getDistributionManager().cacheTimeMillis(), this.region); try { stats.incEvaluations(this.region.size()); try { PartitionedRegion pr = (PartitionedRegion)this.region; stats.incEvictionsInProgress(); int bucketId = PartitionedRegionHelper.getHashKey(pr, routingObj); BucketRegion br = pr.getDataStore().getLocalBucketById(bucketId); stats.incEvictions(); } catch (Exception e) { if (this.cache.getLoggerI18n().fineEnabled()) { stats.decEvictionsInProgress(); long endIterationTime = this.cache .getDistributionManager().cacheTimeMillis(); stats.endEvaluation(startEvaluationTime, totalIterationsTime); stats.endCustomEviction(startEvictionTime);
protected boolean cacheWriteBeforeRegionClear(RegionEventImpl event) throws CacheWriterException, TimeoutException { boolean result = false; // 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); } result = true; } serverRegionClear(event); return result; }
stats = region.getCachePerfStats(); long startTime = stats.startEvaluation(); try { if (region.getLogWriterI18n().fineEnabled()) { stats.incEvaluations(); stats.endEvaluation(startTime, 0);
long giiStart = this.region.getCachePerfStats().startGetInitialImage(); 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);
/** * @param start the timestamp taken when the operation started */ @Override public void endGet(long start, boolean miss) { if (enableClockStats) { stats.incLong(getTimeId, getStatTime()-start); } stats.incInt(getsId, 1); if (miss) { stats.incInt(missesId, 1); } this.cachePerfStats.endGet(start, miss); } /**
logger.trace("dispatchListenerEvent event={}", event); final long start = getCachePerfStats().startCacheListenerCall(); getCachePerfStats().endCacheListenerCall(start); if (isOriginRemoteSet) { ((EntryEventImpl)event).setOriginRemote(origOriginRemote);
this.cachePerfStats = new CachePerfStats(system); CachePerfStats.enableClockStats = this.system.getConfig().getEnableTimeStatistics(); this.eventThreadPool = new PooledExecutorWithDMStats(q, 16, this.cachePerfStats.getEventPoolHelper(), tf, 1000, new CallerRunsPolicy()); } else {
/** * @param start the timestamp taken when the operation started */ @Override public void endGetInitialImage(long start) { if (enableClockStats) { stats.incLong(getInitialImageTimeId, getStatTime()-start); } stats.incInt(getInitialImagesInProgressId, -1); stats.incInt(getInitialImagesCompletedId, 1); this.cachePerfStats.endGetInitialImage(start); }
/** * @param start the timestamp taken when the operation started */ @Override public void endCacheWriterCall(long start) { if (enableClockStats) { stats.incLong(cacheWriterCallTimeId, getStatTime()-start); } stats.incInt(cacheWriterCallsInProgressId, -1); stats.incInt(cacheWriterCallsCompletedId, 1); this.cachePerfStats.endCacheWriterCall(start); }
/** * @param start the timestamp taken when the operation started * @since 3.5 */ @Override public void endCacheListenerCall(long start) { if (enableClockStats) { stats.incLong(cacheListenerCallTimeId, getStatTime()-start); } stats.incInt(cacheListenerCallsInProgressId, -1); stats.incInt(cacheListenerCallsCompletedId, 1); this.cachePerfStats.endCacheListenerCall(start); }
long startEvictionTime = stats.startCustomEviction(); int evicted = 0; long startEvaluationTime = stats.startEvaluation(); Iterator<Entry<Object, Object>> keysItr = null; long totalIterationsTime = 0; .getDistributionManager().cacheTimeMillis(), this.region); try { stats.incEvaluations(this.region.size()); try { PartitionedRegion pr = (PartitionedRegion)this.region; stats.incEvictionsInProgress(); int bucketId = PartitionedRegionHelper.getHashKey(pr, routingObj); BucketRegion br = pr.getDataStore().getLocalBucketById(bucketId); stats.incEvictions(); } catch (Exception e) { if (this.cache.getLoggerI18n().fineEnabled()) { stats.decEvictionsInProgress(); long endIterationTime = this.cache .getDistributionManager().cacheTimeMillis(); stats.endEvaluation(startEvaluationTime, totalIterationsTime); stats.endCustomEviction(startEvictionTime);
protected boolean cacheWriteBeforeRegionClear(RegionEventImpl event) throws CacheWriterException, TimeoutException { boolean result = false; // 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); } result = true; } serverRegionClear(event); return result; }
stats = region.getCachePerfStats(); long startTime = stats.startEvaluation(); try { if (region.getLogWriterI18n().fineEnabled()) { stats.incEvaluations(); stats.endEvaluation(startTime, 0);
long giiStart = this.region.getCachePerfStats().startGetInitialImage(); Thread.currentThread().interrupt(); region.getCancelCriterion().checkCancelInProgress(ie); this.region.getCachePerfStats().endNoGIIDone(giiStart); interrupted = true; return GIIStatus.NO_GII; Thread.currentThread().interrupt(); region.getCancelCriterion().checkCancelInProgress(ie); this.region.getCachePerfStats().endNoGIIDone(giiStart); interrupted = true; return GIIStatus.NO_GII; this.region.getCachePerfStats().endGetInitialImage(giiStart); if (this.isDeltaGII) { this.region.getCachePerfStats().incDeltaGIICompleted(); this.region.getCachePerfStats().endNoGIIDone(giiStart);