cryptoe commented on code in PR #16873:
URL: https://github.com/apache/druid/pull/16873#discussion_r1710825428


##########
server/src/main/java/org/apache/druid/segment/metadata/CoordinatorSegmentMetadataCache.java:
##########
@@ -580,36 +585,61 @@ protected void coldDatasourceSchemaExec()
         if (optionalSchema.isPresent()) {
           RowSignature rowSignature = 
optionalSchema.get().getSchemaPayload().getRowSignature();
           mergeRowSignature(columnTypes, rowSignature);
+          coldSegmentWithSchema++;
         }
-        segments++;
+        coldSegments++;
       }
 
-      if (columnTypes.isEmpty()) {
+      if (coldSegments == 0) {
         // this datasource doesn't have any cold segment
         continue;
       }
 
+      totalColdSegments += coldSegments;
+
+      String dataSourceName = dataSource.getName();
+
+      ServiceMetricEvent.Builder metricBuilder =
+          new 
ServiceMetricEvent.Builder().setDimension(DruidMetrics.DATASOURCE, 
dataSourceName);
+
+      emitter.emit(metricBuilder.setMetric("metadatacache/cold/segment/count", 
coldSegments));

Review Comment:
   Nit: Use a prefix for `metadatacache/cold/segment/`



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