Skip to content

Commit

Permalink
#1109 Make default metric listener queue size configurable by propert…
Browse files Browse the repository at this point in the history
…y hystrix.stream.defaultMetricListenerQueueSize (still defaults to 1000 if unspecified)
  • Loading branch information
awazalwar committed Mar 10, 2016
1 parent a88b30b commit 1410bee
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public class HystrixMetricsStreamServlet extends HttpServlet {
/* used to track number of connections and throttle */
private static AtomicInteger concurrentConnections = new AtomicInteger(0);
private static DynamicIntProperty maxConcurrentConnections = DynamicPropertyFactory.getInstance().getIntProperty("hystrix.stream.maxConcurrentConnections", 5);
private static DynamicIntProperty defaultMetricListenerQueueSize = DynamicPropertyFactory.getInstance().getIntProperty("hystrix.stream.defaultMetricListenerQueueSize", 1000);

private static volatile boolean isDestroyed = false;

Expand Down Expand Up @@ -135,11 +136,11 @@ private void handleRequest(HttpServletRequest request, HttpServletResponse respo
response.setHeader("Cache-Control", "no-cache, no-store, max-age=0, must-revalidate");
response.setHeader("Pragma", "no-cache");

int queueSize = 1000;
int queueSize = defaultMetricListenerQueueSize.get();
try {
String q = request.getParameter("queueSize");
if (q != null) {
queueSize = Math.max(Integer.parseInt(q), queueSize);
queueSize = Integer.parseInt(q);
}
} catch (Exception e) {
// ignore if it's not a number
Expand Down

0 comments on commit 1410bee

Please sign in to comment.