Skip to content

Commit

Permalink
Made dashboard data emission interval configurable on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Jacobs committed Jun 22, 2016
1 parent a2ee1c4 commit 62de321
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package com.netflix.hystrix.metric.consumer;

import com.netflix.config.DynamicIntProperty;
import com.netflix.config.DynamicPropertyFactory;
import com.netflix.hystrix.HystrixCollapserMetrics;
import com.netflix.hystrix.HystrixCommandMetrics;
import com.netflix.hystrix.HystrixThreadPoolMetrics;
Expand All @@ -31,6 +33,9 @@ public class HystrixDashboardStream {
final Observable<DashboardData> singleSource;
final AtomicBoolean isSourceCurrentlySubscribed = new AtomicBoolean(false);

private static final DynamicIntProperty dataEmissionIntervalInMs =
DynamicPropertyFactory.getInstance().getIntProperty("hystrix.stream.dashboard.intervalInMilliseconds", 500);

private HystrixDashboardStream(int delayInMs) {
this.delayInMs = delayInMs;
this.singleSource = Observable.interval(delayInMs, TimeUnit.MILLISECONDS)
Expand Down Expand Up @@ -60,7 +65,9 @@ public void call() {
.onBackpressureDrop();
}

private static final HystrixDashboardStream INSTANCE = new HystrixDashboardStream(500);
//The data emission interval is looked up on startup only
private static final HystrixDashboardStream INSTANCE =
new HystrixDashboardStream(dataEmissionIntervalInMs.get());

public static HystrixDashboardStream getInstance() {
return INSTANCE;
Expand Down

0 comments on commit 62de321

Please sign in to comment.