kfaraz commented on code in PR #14453:
URL: https://github.com/apache/druid/pull/14453#discussion_r1236654114


##########
sql/src/main/java/org/apache/druid/sql/calcite/schema/SegmentMetadataCache.java:
##########
@@ -714,7 +715,12 @@ private Set<SegmentId> refreshSegmentsForDataSource(final 
String dataSource, fin
 
     log.debug("Refreshing metadata for dataSource[%s].", dataSource);
 
-    final long startTime = System.currentTimeMillis();
+    final ServiceMetricEvent.Builder builder =
+        new ServiceMetricEvent.Builder().setDimension(DruidMetrics.DATASOURCE, 
dataSource);
+
+    emitter.emit(builder.build("segment/metadatacache/refresh/count", 
segments.size()));
+
+    final long startNanos = System.nanoTime();

Review Comment:
   Nit: This should probably be the first line of the method, so that we 
account for all the operations here.



##########
sql/src/main/java/org/apache/druid/sql/calcite/schema/SegmentMetadataCache.java:
##########
@@ -783,10 +789,13 @@ private Set<SegmentId> refreshSegmentsForDataSource(final 
String dataSource, fin
       yielder.close();
     }
 
+    long refreshDurationMillis = (System.nanoTime() - startNanos) / 1_000_000;

Review Comment:
   Nit: for readability
   ```suggestion
       long refreshDurationMillis = 
TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNanos);
   ```



-- 
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