/** * This is to be used where at GFE layer we have captured * beginTime with System.nanoTime instead of NanoTimer.nanoTime. */ public static final long recordStdTiming(final long startTime) { return DistributionStats.getStatTimeNoCheck() - startTime; }
public void startJob() { incNumSerialThreadJobs(1); if (logger.isTraceEnabled()) { logger.trace("[DM.SerialQueuedExecutor.execute] numSerialThreads={}", getNumSerialThreads()); } } public void endJob() {
this.stats = new DistributionStats(system, statId); DistributionStats.enableClockStats = system.getConfig().getEnableTimeStatistics(); poolQueue = new OverflowQueueWithDMStats(this.stats.getSerialQueueHelper()); } else { this.serialQueue = new ThrottlingMemLinkedQueueWithDMStats(TOTAL_SERIAL_QUEUE_BYTE_LIMIT, TOTAL_SERIAL_QUEUE_THROTTLE, SERIAL_QUEUE_SIZE_LIMIT, SERIAL_QUEUE_SIZE_THROTTLE, this.stats.getSerialQueueHelper()); poolQueue = this.serialQueue; this.stats.getSerialProcessorHelper(), tf); this.serialThread = executor; this.stats.getViewProcessorHelper(), tf); poolQueue = new OverflowQueueWithDMStats(this.stats.getOverflowQueueHelper()); } else { poolQueue = new OverflowQueueWithDMStats(INCOMING_QUEUE_LIMIT, this.stats.getOverflowQueueHelper()); new PooledExecutorWithDMStats(poolQueue, MAX_THREADS, this.stats.getNormalPoolHelper(), tf); this.threadPool = pool; poolQueue = new OverflowQueueWithDMStats(this.stats.getHighPriorityQueueHelper()); } else { poolQueue = new OverflowQueueWithDMStats(INCOMING_QUEUE_LIMIT, this.stats.getHighPriorityQueueHelper()); this.highPriorityPool = new PooledExecutorWithDMStats(poolQueue, MAX_THREADS, this.stats.getHighPriorityPoolHelper(), tf); poolQueue = new OverflowQueueWithDMStats(this.stats.getWaitingQueueHelper());
/** * Process an incoming distribution message. * This includes scheduling it correctly based on the message's * nioPriority (executor type) */ public void handleIncomingDMsg(DistributionMessage message) { /* disabled - not being used if (message instanceof OutgoingMessageWrapper) { putOutgoing(((OutgoingMessageWrapper)message).getMessage()); return; } */ // long latency = message.getLatency(); // this.stats.incMessageTransitTime(latency * 1000000L); // message.resetTimestamp(); stats.incReceivedMessages(1L); stats.incReceivedBytes(message.getBytesRead()); stats.incMessageChannelTime(message.resetTimestamp()); // message.setRecipient(DistributionManager.this.getId()); if (logger.isDebugEnabled()) { logger.debug("Received message '{}' from <{}>", message, message.getSender()); } scheduleIncomingMessage(message); }
public void testRates() throws InterruptedException { for (int i = 0; i < 20; i++) { cachePerfStats.incCreates(); cachePerfStats.incDestroys(); funcServiceStats.incFunctionExecutionsCompleted(); distributionStats.incSentBytes(20); distributionStats.incReceivedBytes(20); } sample(); float createsRate = getCreatesRate(); float destroyRate = getDestroysRate(); float functionExecutionRate = getFunctionExecutionRate(); float byteSentRate = getBytesSentRate(); float byteReceivedRate = getBytesReceivedRate(); print("createsRate is " + new Float(createsRate).toString()); print("destroyRate is " + new Float(destroyRate).toString()); print("functionExecutionRate is " + new Float(functionExecutionRate).toString()); print("byteSentRate is " + new Float(byteSentRate).toString()); print("byteReceivedRate is " + new Float(byteReceivedRate).toString()); assertTrue(createsRate > 0); assertTrue(destroyRate > 0); assertTrue(functionExecutionRate > 0); assertTrue(byteSentRate > 0); assertTrue(byteReceivedRate > 0); }
public void init() { cachePerfStats = new CachePerfStats(system); funcServiceStats = new FunctionServiceStats(system, "FunctionExecution"); long statId = OSProcess.getId(); distributionStats = new DistributionStats(system, statId); DistributionStats.enableClockStats = true; dlockStats = new DLockStats(system, statId); bridge = new MemberMBeanBridge(); bridge.addCacheStats(cachePerfStats); bridge.addFunctionStats(funcServiceStats); bridge.addDistributionStats(distributionStats); bridge.addLockServiceStats(dlockStats); bridge.addSystemStats(); bridge.addVMStats(); for(int i = 0; i<4 ; i++){ DiskStoreStats stats = new DiskStoreStats(system, getName()+i); diskStatsList.add(stats); bridge.addDiskStoreStats(stats); } for(int i = 0; i<4 ; i++){ PartitionedRegionStats stats = new PartitionedRegionStats(system, getName()+i); parRegionStatsList.add(stats); bridge.addPartionRegionStats(stats); } }
this.stats.close(); try { Thread.sleep(100); } catch (InterruptedException ie) {
this.stats = new DistributionStats(system, statId); DistributionStats.enableClockStats = system.getConfig().getEnableTimeStatistics(); poolQueue = new OverflowQueueWithDMStats(this.stats.getSerialQueueHelper()); } else { this.serialQueue = new ThrottlingMemLinkedQueueWithDMStats(TOTAL_SERIAL_QUEUE_BYTE_LIMIT, TOTAL_SERIAL_QUEUE_THROTTLE, SERIAL_QUEUE_SIZE_LIMIT, SERIAL_QUEUE_SIZE_THROTTLE, this.stats.getSerialQueueHelper()); poolQueue = this.serialQueue; this.stats.getSerialProcessorHelper(this.logger), tf); this.serialThread = executor; this.stats.getViewProcessorHelper(this.logger), tf); poolQueue = new OverflowQueueWithDMStats(this.stats.getOverflowQueueHelper()); } else { poolQueue = new OverflowQueueWithDMStats(INCOMING_QUEUE_LIMIT, this.stats.getOverflowQueueHelper()); new PooledExecutorWithDMStats(poolQueue, MAX_THREADS, this.stats.getNormalPoolHelper(), tf); this.threadPool = pool; poolQueue = new OverflowQueueWithDMStats(this.stats.getHighPriorityQueueHelper()); } else { poolQueue = new OverflowQueueWithDMStats(INCOMING_QUEUE_LIMIT, this.stats.getHighPriorityQueueHelper()); this.highPriorityPool = new PooledExecutorWithDMStats(poolQueue, MAX_THREADS, this.stats.getHighPriorityPoolHelper(), tf); poolQueue = new OverflowQueueWithDMStats(this.stats.getWaitingQueueHelper());
stats.incReceivedMessages(1L); stats.incReceivedBytes(message.getBytesRead()); stats.incMessageChannelTime(message.resetTimestamp());
this.stats.close(); try { Thread.sleep(100); } catch (InterruptedException ie) {
/** * This is to be used where at GFE layer we have captured * beginTime with System.nanoTime instead of NanoTimer.nanoTime. */ public static final long recordStdTiming(final long startTime) { return DistributionStats.getStatTimeNoCheck() - startTime; }
public void startJob() { incNumSerialThreadJobs(1); if (l.finerEnabled()) { l.finer("[DM.SerialQueuedExecutor.execute] numSerialThreads=" + getNumSerialThreads()); } } public void endJob() {
protected DistributionMessage() { this.timeStatsEnabled = DistributionStats.enableClockStats; if(this.timeStatsEnabled) { this.timeStamp = DistributionStats.getStatTimeNoCheck(); } }
/** * This is to be used where at GFE layer we have captured * beginTime with System.nanoTime instead of NanoTimer.nanoTime. */ public static final long recordStdTiming(final long startTime) { return DistributionStats.getStatTimeNoCheck() - startTime; }
/** * Sets the timestamp of this message to the current time (in nanos). * @return the number of elapsed nanos since this message's last timestamp */ public long resetTimestamp() { if (this.timeStatsEnabled) { long now = DistributionStats.getStatTimeNoCheck(); long result = now - this.timeStamp; this.timeStamp = now; return result; } else { return 0; } }
this.timeStamp = DistributionStats.getStatTimeNoCheck();
this.timeStatsEnabled = testFlag(status,TIME_STATS_SET); if(timeStatsEnabled) { timeStamp = DistributionStats.getStatTimeNoCheck();
public final void dmProcess(final DM dm) { // TODO: because startTime uses getTimeStamp replyMessageTime // ends up measuring both messageProcessingScheduleTime and // processedMessagesTime. I'm not sure this was intended. // I've added this info to the stat description so update it // if the startTime changes. final long startTime = getTimestamp(); ReplyProcessor21 processor = ReplyProcessor21.getProcessor(processorId); try { this.process(dm, processor); if (DistributionManager.VERBOSE) { LogWriterI18n logger = dm.getLoggerI18n(); logger.info(LocalizedStrings.ReplyMessage_0__PROCESSED__1, new Object[] {processor, this}); } if (this.timeStatsEnabled) { dm.getStats().incReplyMessageTime( DistributionStats.getStatTimeNoCheck() - startTime); } } catch (RuntimeException ex) { if (processor != null) { processor.cancel(getSender(), ex); } throw ex; } }
long time = 0; if (this.timeStatsEnabled) { time = DistributionStats.getStatTimeNoCheck(); dm.getStats().incMessageProcessingScheduleTime(time-getTimestamp());