You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/04/19 21:48:47 UTC

[GitHub] [flink] afedulov commented on a diff in pull request #19228: [FLINK-26074] Improve FlameGraphs scalability for high parallelism jobs

afedulov commented on code in PR #19228:
URL: https://github.com/apache/flink/pull/19228#discussion_r853514163


##########
flink-runtime/src/main/java/org/apache/flink/runtime/messages/ThreadInfoSample.java:
##########
@@ -54,6 +61,27 @@ private ThreadInfoSample(Thread.State threadState, StackTraceElement[] stackTrac
         }
     }
 
+    /**
+     * Constructs a collection of {@link ThreadInfoSample}s from a {@link ThreadInfo} array.
+     *
+     * @param threadInfos {@link ThreadInfo} array where the data will be copied from.
+     * @return a Collection of the corresponding {@link ThreadInfoSample}s
+     */
+    public static Collection<ThreadInfoSample> from(ThreadInfo[] threadInfos) {
+        Collection<ThreadInfoSample> result = new ArrayList<>();
+        for (ThreadInfo threadInfo : threadInfos) {
+            if (threadInfo == null) {
+                LOG.warn("Missing thread info.");

Review Comment:
   I decided to handle still handle it here, but provide additional context to the method.



-- 
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: issues-unsubscribe@flink.apache.org

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