Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimone Bordet2015-12-24 11:10:20 +0000
committerSimone Bordet2015-12-24 11:10:20 +0000
commit997b868ecd1c8582305d87bf37e77ce7d079d940 (patch)
tree8daf9ba8b811244782f96337115ee5e9b64125af
parent24b99d4b330d389f2d11ca7e1e12dae1a70cc5e9 (diff)
downloadorg.eclipse.jetty.project-997b868ecd1c8582305d87bf37e77ce7d079d940.tar.gz
org.eclipse.jetty.project-997b868ecd1c8582305d87bf37e77ce7d079d940.tar.xz
org.eclipse.jetty.project-997b868ecd1c8582305d87bf37e77ce7d079d940.zip
484878 - Make BufferingFlowControlStrategy.bufferRatio configurable via JMX.
Made the property writable.
-rw-r--r--jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/BufferingFlowControlStrategy.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/BufferingFlowControlStrategy.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/BufferingFlowControlStrategy.java
index 875d472da0..d540ebd1f9 100644
--- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/BufferingFlowControlStrategy.java
+++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/BufferingFlowControlStrategy.java
@@ -57,7 +57,7 @@ public class BufferingFlowControlStrategy extends AbstractFlowControlStrategy
private final AtomicInteger maxSessionRecvWindow = new AtomicInteger(DEFAULT_WINDOW_SIZE);
private final AtomicInteger sessionLevel = new AtomicInteger();
private final Map<IStream, AtomicInteger> streamLevels = new ConcurrentHashMap<>();
- private final float bufferRatio;
+ private float bufferRatio;
public BufferingFlowControlStrategy(float bufferRatio)
{
@@ -76,6 +76,11 @@ public class BufferingFlowControlStrategy extends AbstractFlowControlStrategy
return bufferRatio;
}
+ public void setBufferRatio(float bufferRatio)
+ {
+ this.bufferRatio = bufferRatio;
+ }
+
@Override
public void onStreamCreated(IStream stream)
{
@@ -96,9 +101,11 @@ public class BufferingFlowControlStrategy extends AbstractFlowControlStrategy
if (length <= 0)
return;
+ float ratio = bufferRatio;
+
WindowUpdateFrame windowFrame = null;
int level = sessionLevel.addAndGet(length);
- int maxLevel = (int)(maxSessionRecvWindow.get() * bufferRatio);
+ int maxLevel = (int)(maxSessionRecvWindow.get() * ratio);
if (level > maxLevel)
{
level = sessionLevel.getAndSet(0);
@@ -127,7 +134,7 @@ public class BufferingFlowControlStrategy extends AbstractFlowControlStrategy
if (streamLevel != null)
{
level = streamLevel.addAndGet(length);
- maxLevel = (int)(getInitialStreamRecvWindow() * bufferRatio);
+ maxLevel = (int)(getInitialStreamRecvWindow() * ratio);
if (level > maxLevel)
{
level = streamLevel.getAndSet(0);

Back to the top