package org.opendaylight.infrautils.metrics.sample;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import static org.opendaylight.infrautils.utils.concurrent.JdkFutures.addErrorLogging;
+import static org.opendaylight.infrautils.utils.concurrent.LoggingFutures.addErrorLogging;
import java.util.Random;
import java.util.concurrent.ScheduledExecutorService;
private final Meter meterWithTwoFixedLabels;
private final Labeled<Meter> meterWithOneDynamicLabel;
- private final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor("cron", LOG);
+ private final ScheduledExecutorService executor = Executors.newListeningSingleThreadScheduledExecutor("cron", LOG);
private final Random random = new Random();
@Inject
}
@PostConstruct
+ @SuppressWarnings("FutureReturnValueIgnored")
public void init() {
addErrorLogging(executor.scheduleWithFixedDelay(this, 0, 500, MILLISECONDS), LOG, "schedule interrupted");
}