Skip to content

Commit

Permalink
Add maximumSize to Hystrix Configuration stream
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Jacobs committed Oct 4, 2016
1 parent c21d586 commit 9d9f1ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@ public class HystrixThreadPoolConfiguration {
private static final String VERSION = "1";
private final HystrixThreadPoolKey threadPoolKey;
private final int coreSize;
private final int maximumSize;
private final int maxQueueSize;
private final int queueRejectionThreshold;
private final int keepAliveTimeInMinutes;
private final int rollingCounterNumberOfBuckets;
private final int rollingCounterBucketSizeInMilliseconds;

public HystrixThreadPoolConfiguration(HystrixThreadPoolKey threadPoolKey, int coreSize, int maxQueueSize, int queueRejectionThreshold,
public HystrixThreadPoolConfiguration(HystrixThreadPoolKey threadPoolKey, int coreSize, int maximumSize, int maxQueueSize, int queueRejectionThreshold,
int keepAliveTimeInMinutes, int rollingCounterNumberOfBuckets,
int rollingCounterBucketSizeInMilliseconds) {
this.threadPoolKey = threadPoolKey;
this.coreSize = coreSize;
this.maximumSize = maximumSize;
this.maxQueueSize = maxQueueSize;
this.queueRejectionThreshold = queueRejectionThreshold;
this.keepAliveTimeInMinutes = keepAliveTimeInMinutes;
Expand All @@ -45,6 +47,7 @@ public static HystrixThreadPoolConfiguration sample(HystrixThreadPoolKey threadP
return new HystrixThreadPoolConfiguration(
threadPoolKey,
threadPoolProperties.coreSize().get(),
threadPoolProperties.maximumSize().get(),
threadPoolProperties.maxQueueSize().get(),
threadPoolProperties.queueSizeRejectionThreshold().get(),
threadPoolProperties.keepAliveTimeMinutes().get(),
Expand All @@ -60,6 +63,10 @@ public int getCoreSize() {
return coreSize;
}

public int getMaximumSize() {
return maximumSize;
}

public int getMaxQueueSize() {
return maxQueueSize;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ private static void writeCommandConfigJson(JsonGenerator json, HystrixCommandKey
private static void writeThreadPoolConfigJson(JsonGenerator json, HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolConfiguration threadPoolConfig) throws IOException {
json.writeObjectFieldStart(threadPoolKey.name());
json.writeNumberField("coreSize", threadPoolConfig.getCoreSize());
json.writeNumberField("maximumSize", threadPoolConfig.getMaximumSize());
json.writeNumberField("maxQueueSize", threadPoolConfig.getMaxQueueSize());
json.writeNumberField("queueRejectionThreshold", threadPoolConfig.getQueueRejectionThreshold());
json.writeNumberField("keepAliveTimeInMinutes", threadPoolConfig.getKeepAliveTimeInMinutes());
Expand Down

0 comments on commit 9d9f1ed

Please sign in to comment.