@Scheduled(fixedRateString = "${sample_stat_fixed_rate}") private void sampleStatus() { log.info("sampling Status... "); OtrosWebStatus stats = cacheHolder.getStatus(); stats.numThreads = logReader.getNumThreads(); // statsHistory.add(status); log.info("logReader.getNumThreads(): " + logReader.getNumThreads()); if (normalizedStatistics.numThreads.size() > MAX_RECORDS_IN_HISTORY) { normalizedStatistics.numThreads.remove(0); normalizedStatistics.numElementsInCache.remove(0); normalizedStatistics.timeOfMeasurements.remove(0); } normalizedStatistics.numThreads.add(logReader.getNumThreads()); normalizedStatistics.numElementsInCache.add(stats.numElementsInCache); normalizedStatistics.timeOfMeasurements.add(new Date()); }
public OtrosWebStatus getCurrentStatistics() { OtrosWebStatus stats = cacheHolder.getStatus(); stats.numThreads = logReader.getNumThreads(); return stats; }