Demo entry 6353103

java

   

Submitted by anonymous on Mar 29, 2017 at 08:37
Language: Java. Code size: 792 Bytes.

public class RedisMetricsServer {
    private static ScheduledExecutorService scheduledExecutorService;
    public static void main(String[] args) {
        System.out.println("RedisMetricsServer::main()");
        RedisMetricsSink redisTimeLineSend = new RedisMetricsSink();
        RedisMetricsCollector timelineMetricsCollector = new RedisMetricsCollector(redisTimeLineSend);
        if (scheduledExecutorService == null || scheduledExecutorService.isShutdown() || scheduledExecutorService.isTerminated()) {
          scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
        }
        scheduledExecutorService.scheduleWithFixedDelay(timelineMetricsCollector, 0,
                      redisTimeLineSend.getPollFrequency(), TimeUnit.MILLISECONDS);
    }
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).