yiguolei commented on code in PR #33690:
URL: https://github.com/apache/doris/pull/33690#discussion_r1686008692


##########
fe/fe-core/src/main/java/org/apache/doris/common/util/ProfileManager.java:
##########
@@ -255,17 +247,26 @@ public List<List<String>> getAllQueries() {
         return getQueryWithType(null);
     }
 
+    // The init value of query finish time of profile is MIN_VALUE
+    // So more recent query will be on the top of heap
+    private PriorityQueue<ProfileElement> getQueryOrderByQueryFinishTime() {
+        PriorityQueue<ProfileElement> queryIdDeque = new 
PriorityQueue<>(Comparator.comparingLong(
+                (ProfileElement profileElement) -> 
profileElement.profile.getQueryFinishTimestamp()));
+
+        queryIdToProfileMap.forEach((queryId, profileElement) -> {
+            queryIdDeque.add(profileElement);
+        });
+
+        return queryIdDeque;
+    }
+
     public List<List<String>> getQueryWithType(ProfileType type) {

Review Comment:
   删掉这个函数,这个函数只有在getAllQueries的时候有用,所以我们只要实现getAllQueries 这个函数就可以了。



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to