Hisoka-X commented on code in PR #8173:
URL: https://github.com/apache/seatunnel/pull/8173#discussion_r1887859814


##########
seatunnel-common/src/main/java/org/apache/seatunnel/common/utils/StringFormatUtils.java:
##########
@@ -43,4 +45,28 @@ public static String formatTable(Object... objects) {
                         + "***********************************************\n";
         return String.format(template, objects);
     }
+
+    @SneakyThrows
+    public static String transformFormatTable(Object... objects) {

Review Comment:
   Could you add some test case for `StringFormatUtils`? Thanks.



##########
seatunnel-api/src/main/java/org/apache/seatunnel/api/common/metrics/MetricNames.java:
##########
@@ -33,4 +33,5 @@ private MetricNames() {}
     public static final String SINK_WRITE_BYTES = "SinkWriteBytes";
     public static final String SINK_WRITE_QPS = "SinkWriteQPS";
     public static final String SINK_WRITE_BYTES_PER_SECONDS = 
"SinkWriteBytesPerSeconds";
+    public static final String TRANSFORM_COUNT = "TransformCount";

Review Comment:
   `TransformCount` -> `TransformOutputCount`



##########
seatunnel-api/src/main/java/org/apache/seatunnel/api/transform/SeaTunnelTransform.java:
##########
@@ -54,4 +56,19 @@ default SchemaChangeEvent 
mapSchemaChangeEvent(SchemaChangeEvent schemaChangeEve
 
     /** call it when Transformer completed */
     default void close() {}
+
+    void loadContext(Context context);
+
+    interface Context extends Serializable {
+
+        /** @return metricsContext of this reader. */
+        MetricsContext getMetricsContext();
+
+        /**
+         * Get the {@link EventListener} of this writer.
+         *
+         * @return
+         */
+        EventListener getEventListener();
+    }

Review Comment:
   move set context to `open` method?



##########
seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/MultiTableMetricsIT.java:
##########
@@ -178,6 +196,30 @@ public void multiTableMetrics() {
                                             && Double.parseDouble(
                                                             response.path(
                                                                     
"metrics.TableSinkWriteBytesPerSeconds.'fake.public.table2'"))
+                                                    > 0
+                                            && Double.parseDouble(
+                                                            response.path(
+                                                                    
"metrics.TransformCount.'fake.table1'.'fake1->fake3'"))

Review Comment:
   Not all sql transform contains `plugin_input` or `plugin_output`. So I think 
we can not put it into metrics name. How about use 
`metrics.TransformCount.Transform1.'fake.table1'`?



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