Skip to content

Commit 4e6a835

Browse files
committed
add a new stat to AES
Signed-off-by: Ludovic Orban <[email protected]>
1 parent 7a00be8 commit 4e6a835

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ private enum SubStrategy
130130
private final LongAdder _picMode = new LongAdder();
131131
private final LongAdder _pecMode = new LongAdder();
132132
private final LongAdder _epcMode = new LongAdder();
133+
private final LongAdder _epcProduce = new LongAdder();
133134
private final Producer _producer;
134135
private final Executor _executor;
135136
private final TryExecutor _tryExecutor;
@@ -460,6 +461,7 @@ private boolean consumeTask(Runnable task, SubStrategy subStrategy)
460461
// or it may take over if we subsequently do another EPC consumption.
461462
if (!_state.compareAndSet(biState, pending, PRODUCING))
462463
continue;
464+
_epcProduce.increment();
463465
return true;
464466
}
465467

@@ -601,6 +603,12 @@ public long getEPCTasksConsumed()
601603
return _epcMode.longValue();
602604
}
603605

606+
@ManagedAttribute(value = "number of times a EPC thread produces again", readonly = true)
607+
public long getEPCProduceCount()
608+
{
609+
return _epcProduce.longValue();
610+
}
611+
604612
@ManagedAttribute(value = "whether this execution strategy is idle", readonly = true)
605613
public boolean isIdle()
606614
{
@@ -663,6 +671,8 @@ private void getState(StringBuilder builder, long biState)
663671
builder.append(",pec=");
664672
builder.append(getPECTasksExecuted());
665673
builder.append(",epc=");
674+
builder.append(getEPCProduceCount());
675+
builder.append("/");
666676
builder.append(getEPCTasksConsumed());
667677
builder.append("]");
668678
builder.append("@");

0 commit comments

Comments
 (0)