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 quarkusio#35540

(cherry picked from commit ff67f70)
  • Loading branch information
ahus1 authored and gsmet committed Aug 26, 2023
1 parent c8407fa commit 5b40039
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 5b40039

Please sign in to comment.