ramesh0201 commented on code in PR #4755: URL: https://github.com/apache/hive/pull/4755#discussion_r1442986918
########## common/src/java/org/apache/hadoop/hive/ql/log/PerfLogger.java: ########## @@ -152,10 +178,18 @@ public long perfLogEnd(String callerName, String method) { * @return long duration the difference between now and startTime, or -1 if startTime is null */ public long perfLogEnd(String callerName, String method, String additionalInfo) { - long startTime = startTimes.getOrDefault(method, -1L); + String key = method; + if (additionalInfo != null) { + key = key + " - " + additionalInfo; + } + long startTime = startTimes.getOrDefault(key, -1L); long endTime = System.currentTimeMillis(); - long duration = startTime < 0 ? -1 : endTime - startTime; - endTimes.put(method, Long.valueOf(endTime)); + long duration = startTime < 0 ? -1 : (endTime - startTime + durations.getOrDefault(key, 0L)); + endTimes.put(key, Long.valueOf(endTime)); + durations.put(key, duration); + synchronized(querySteps) { + querySteps.add(key); Review Comment: The reason for having querySteps is to order the log entries in the same order of execution, so that it is easier to understand the flow and to debug. -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org