You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tez.apache.org by GitBox <gi...@apache.org> on 2022/06/09 07:01:53 UTC

[GitHub] [tez] abstractdog commented on a diff in pull request #212: TEZ-4038: Add a /prof profiler endpoint like HiveServer2 has

abstractdog commented on code in PR #212:
URL: https://github.com/apache/tez/pull/212#discussion_r893140138


##########
tez-common/src/main/java/org/apache/tez/common/TezUtilsInternal.java:
##########
@@ -322,6 +323,25 @@ public static <T extends Enum<T>> Set<T> getEnums(Configuration conf, String con
     return enums;
   }
 
+  public static Integer getPid() {
+    String pidStr = null;
+    String name = ManagementFactory.getRuntimeMXBean().getName();
+    if (name != null) {
+      int idx = name.indexOf("@");
+      if (idx != -1) {
+        pidStr = name.substring(0, name.indexOf("@"));
+      }
+    }
+    try {
+      if (pidStr != null) {
+        return Integer.valueOf(pidStr);
+      }
+    } catch (NumberFormatException nfe) {
+      // ignore

Review Comment:
   instead of ignoring it, can we put an INFO level message containing pidStr?



-- 
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@tez.apache.org

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