Skip to content

Commit

Permalink
Add a metric for rejected submissions to the pool
Browse files Browse the repository at this point in the history
Closes #35540

(cherry picked from commit ff67f70)
  • Loading branch information
ahus1 authored and gsmet committed Aug 26, 2023
1 parent b84b213 commit e0aad4e
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class VertxPoolMetrics implements PoolMetrics<EventTiming> {
private final LongAdder current = new LongAdder();
private final LongAdder queue = new LongAdder();
private final Counter completed;
private final Counter rejected;
private final Timer queueDelay;

VertxPoolMetrics(MeterRegistry registry, String poolType, String poolName, int maxPoolSize) {
Expand Down Expand Up @@ -89,6 +90,11 @@ public Number get() {
.tags(tags)
.register(registry);

rejected = Counter.builder(name("rejected"))
.description("Number of times submissions to the pool have been rejected")
.tags(tags)
.register(registry);

}

private String name(String suffix) {
Expand All @@ -104,6 +110,7 @@ public EventTiming submitted() {
@Override
public void rejected(EventTiming submitted) {
queue.decrement();
rejected.increment();
submitted.end();
}

Expand Down

0 comments on commit e0aad4e

Please sign in to comment.