private void printCacheStats(final boolean period) { long now = now(); test.processCacheStats(); // Cache detailed stats LongStat readStat = processor.getReadStat(); LongStat writeStat = processor.getWriteStat(); readStat.snapshot(); writeStat.snapshot(); int readCount = processor.getRead(); int writeCount = processor.getWrite(); int total = readCount + writeCount; if (period) { /* ******************************************************* * Node Periodic Cache Stats * *******************************************************/ log.info("------------------ Cache Stats -----------------------"); int periodReadCount = readCount - readCountAtLastReport; int periodWriteCount = writeCount - writeCountAtLastReport; int periodTotalCount = (total) - (readCountAtLastReport + writeCountAtLastReport); log.info( String.format( "Cache: Period Read iterations/sec = %.1f, completed = %d ", 1000.0 * periodReadCount / (now - lastReportTime), periodReadCount)); log.info( String.format( "Cache: Period Write iterations/sec = %.1f, completed = %d ", 1000.0 * periodWriteCount / (now - lastReportTime), periodWriteCount)); log.info( String.format( "Cache: Period iterations/sec = %.1f, completed = %d ", 1000.0 * periodTotalCount / (now - lastReportTime), periodTotalCount)); readCountAtLastReport = readCount; writeCountAtLastReport = writeCount; } /* ******************************************************* * Cumulative Cache stats * *******************************************************/ log.info( String.format( "Cache: Cumulative Read iterations/sec = %.1f, completed = %d", 1000.0 * readCount / (now - testStartTime), readCount)); log.info( String.format( "Cache: Cumulative Write iterations/sec = %.1f, completed = %d", 1000.0 * writeCount / (now - testStartTime), writeCount)); log.info( String.format( "Cache: Cumulative Total iterations/sec = %.1f, completed = %d", 1000.0 * total / (now - testStartTime), total)); log.info("Cache: Cumulative Read latency: " + readStat); log.info("Cache: Cumulative Write latency: " + writeStat); processor.reset(); }
private void doPeriodReport(final boolean period) { if (period && !isTestRunning()) return; long now = now(); int currentCount = nodeTestCount.get(); latencyStats.snapshot(); this.cumulativeLatencyStats.add(latencyStats); if (period) { log.info(""); log.info("------------------ Test Stats -----------------------"); if (configuration.getTestDuration() < 0) { log.info( "Test running for " + Util.formatTimeInSecondsToWords((now - testStartTime) / 1000)); } else { log.info( "Remaining Time: " + Util.formatTimeInSecondsToWords((estimatedTestEndTime - now) / 1000)); } /* ******************************************************* * Node Periodic Stats * *******************************************************/ int periodTestCount = currentCount - testCountAtLastReport; log.info( String.format( "Node: Period iterations/sec = %.1f, completed = %d ", 1000.0 * periodTestCount / (now - lastReportTime), periodTestCount)); log.info("Node: Period latency: " + latencyStats); testCountAtLastReport = currentCount; } /* ******************************************************* * Node Cumulative Stats * *******************************************************/ int writes = test.getWritesCount(); if (writes > 0) { log.info( String.format( "Node: Cumulative iterations/sec = %.1f, completed = %d , writes = %d (%.1f %%)", 1000.0 * currentCount / (now - testStartTime), currentCount, writes, writes * 100.0 / currentCount)); } else { log.info( String.format( "Node: Cumulative iterations/sec = %.1f, completed = %d", 1000.0 * currentCount / (now - testStartTime), currentCount)); } log.info("Node: Cumulative latency: " + cumulativeLatencyStats); latencyStats.reset(); printCacheStats(period); if (testHasErrors) { log.error( "Node: Test has errors. NonstopCacheException: " + nonstopCacheExceptionCount.get()); } lastReportTime = now; }