rohangarg commented on code in PR #12923:
URL: https://github.com/apache/druid/pull/12923#discussion_r950029608


##########
sql/src/main/java/org/apache/druid/sql/SqlExecutionReporter.java:
##########
@@ -105,9 +111,16 @@ public void emit()
       if (bytesWritten >= 0) {
         emitter.emit(metricBuilder.build("sqlQuery/bytes", bytesWritten));
       }
+      if (planningTimeNanos >= 0) {
+        emitter.emit(metricBuilder.build(
+            "sqlQuery/planningTimeMs",
+            TimeUnit.NANOSECONDS.toMillis(planningTimeNanos)
+        ));
+      }
 
       final Map<String, Object> statsMap = new LinkedHashMap<>();
       statsMap.put("sqlQuery/time", 
TimeUnit.NANOSECONDS.toMillis(queryTimeNs));
+      statsMap.put("sqlQuery/planningTimeMs", 
TimeUnit.NANOSECONDS.toMillis(planningTimeNanos));

Review Comment:
   Also, my thinking was that given it doesn't need any extra space, it is 
better to store the time in the highest resolution. Then we can emit in 
whatever resolution is needed by the callers and also use the highest accuracy 
times for any arithmetic if needed in future.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to