Skip to content

Conversation

sbordet
Copy link
Contributor

@sbordet sbordet commented Oct 2, 2025

Added more statistic counters to QoSHandler.

… exceeding setMaxSuspendedRequestCount.

Added more statistic counters to QoSHandler.

Signed-off-by: Simone Bordet <[email protected]>
private final AtomicInteger state = new AtomicInteger();
private final Map<Integer, Queue<Entry>> queues = new ConcurrentHashMap<>();
private final Set<Integer> priorities = new ConcurrentSkipListSet<>(Comparator.reverseOrder());
private final AtomicLong totalCount = new AtomicLong();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AtomicLong vs LongAdder: we sometimes use the former, sometimes the latter, throughout the classes in which we collect stats.

What's the motivation for using AtomicLong rather than LongAdder here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that this class limits concurrency of requests, contention should not be extreme. Furthermore, we use AtomicInteger for state, so make sense to use AtomicLong for totalCount, which are probably the 2 fields exposed to most contention.

Signed-off-by: Simone Bordet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

Missing hook or statistic for QoSHandler rejections by exceeding setMaxSuspendedRequestCount
2 participants