- timer.schedule(new TimerTask() {
- @Override
- public void run() {
- try {
- // Send stats requests
- for (NodeStatisticsHandler h : handlers.values()) {
- h.requestPeriodicStatistics();
- }
-
- // Perform cleanup
- for(NodeStatisticsHandler nodeStatisticsAger : handlers.values()){
- nodeStatisticsAger.cleanStaleStatistics();
- }
-
- } catch (RuntimeException e) {
- spLogger.warn("Failed to request statistics", e);
- }
- }
- }, 0, STATS_COLLECTION_MILLIS);
-
- spLogger.debug("Statistics timer task with timer interval : {}ms", STATS_COLLECTION_MILLIS);