MetricObserver transform = new CounterToRateMetricTransform(
new FileMetricObserver("ZuulMetrics", metricsDir),
heartbeatInterval, TimeUnit.SECONDS);
PollRunnable task = new PollRunnable(
new MonitorRegistryMetricPoller(),
BasicMetricFilter.MATCH_ALL,
transform);
final int samplingInterval = 10;
scheduler.addPoller(task, samplingInterval, TimeUnit.SECONDS);