You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2022/03/11 09:37:11 UTC

[skywalking] branch enhance-queue updated: Fix comments.

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch enhance-queue
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/enhance-queue by this push:
     new 0bec611  Fix comments.
0bec611 is described below

commit 0bec6112af760ba6d71414d888102ea8fed63ae2
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Fri Mar 11 17:36:53 2022 +0800

    Fix comments.
---
 .../datacarrier/consumer/MultipleChannelsConsumer.java     | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/oap-server/server-library/library-datacarrier-queue/src/main/java/org/apache/skywalking/oap/server/library/datacarrier/consumer/MultipleChannelsConsumer.java b/oap-server/server-library/library-datacarrier-queue/src/main/java/org/apache/skywalking/oap/server/library/datacarrier/consumer/MultipleChannelsConsumer.java
index a1f327b..23c6b39 100644
--- a/oap-server/server-library/library-datacarrier-queue/src/main/java/org/apache/skywalking/oap/server/library/datacarrier/consumer/MultipleChannelsConsumer.java
+++ b/oap-server/server-library/library-datacarrier-queue/src/main/java/org/apache/skywalking/oap/server/library/datacarrier/consumer/MultipleChannelsConsumer.java
@@ -96,12 +96,20 @@ public class MultipleChannelsConsumer extends Thread {
          * to fetch the data from queue, if the queue only contains few elements, it is too expensive to consume every
          * time.
          *
+         * if 'size of last fetched data' > 0
+         *
          * priority = 'size of last fetched data' * 100 / {@link Channels#size()} * {@link Channels#getChannelSize()}
+         *
+         * else
+         *
+         * priority = priority / 2
+         *
          * Meaning, priority is the load factor of {@link #channels}
          *
-         * In every consuming loop, priority = (priority of current loop + priority of last loop) / 2 If priority > 50,
-         * consuming happens in next loop, otherwise, priority += 10, and wait until priority > 50. In worth case, for a
-         * low traffic group, consuming happens in 1/10.
+         * After consuming loop, priority = (priority of current loop + priority of last loop) / 2.
+         *
+         * If priority > 50, consuming happens in next loop, otherwise, priority += 10, and wait until priority > 50. In
+         * worth case, for a low traffic group, consuming happens in 1/10.
          *
          * Priority only exists in {@link MultipleChannelsConsumer}, because it has limited threads but has to consume
          * from a large set of queues.