davidzollo commented on code in PR #10100:
URL: https://github.com/apache/seatunnel/pull/10100#discussion_r2556756870


##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/metrics/ConnectorMetricsCalcContext.java:
##########
@@ -127,51 +177,130 @@ public void updateMetrics(Object data, String tableId) {
         QPS.markEvent();
         if (data instanceof SeaTunnelRow) {
             SeaTunnelRow row = (SeaTunnelRow) data;
-            bytes.inc(row.getBytesSize());
-            bytesPerSeconds.markEvent(row.getBytesSize());
+            long rowBytes = row.getBytesSize();
+            bytes.inc(rowBytes);
+            bytesPerSeconds.markEvent(rowBytes);
 
-            if (StringUtils.isNotBlank(tableId)) {
-                String tableName = TablePath.of(tableId).getFullName();
+            String normalizedTableName =
+                    StringUtils.isNotBlank(tableId) ? 
normalizeTableName(tableId) : null;

Review Comment:
   // Suggested modification:
   private final Map<String, String> tableNameCache = new ConcurrentHashMap<>();
   
   private String normalizeTableName(String tableId) {
       return tableNameCache.computeIfAbsent(tableId, id -> 
TablePath.of(id).getFullName());
   }



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

Reply via email to