You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "EMsnap (via GitHub)" <gi...@apache.org> on 2023/09/22 06:40:55 UTC
[GitHub] [inlong] EMsnap commented on a diff in pull request #8970: [INLONG-8969][Sort] Optimize Iceberg Source audit report logic
EMsnap commented on code in PR #8970:
URL: https://github.com/apache/inlong/pull/8970#discussion_r1333945006
##########
inlong-sort/sort-flink/sort-flink-v1.15/sort-connectors/iceberg/src/main/java/org/apache/inlong/sort/iceberg/source/reader/InlongIcebergSourceReaderMetrics.java:
##########
@@ -48,8 +52,29 @@ public void registerMetrics(MetricOption metricOption) {
public void outputMetricsWithEstimate(ArrayBatchRecords batchRecord) {
if (sourceMetricData != null) {
- sourceMetricData.outputMetricsWithEstimate(batchRecord.records());
+ int dataCount = batchRecord.numberOfRecords();
+ Object[] records = batchRecord.records();
+ for (int i = 0; i < dataCount; i++) {
+ long dataSize = getDataSize(records[i]);
+ long dataTime = getDataTime(records[i]);
+ sourceMetricData.outputMetrics(1, dataSize, dataTime);
+ }
+
}
+ }
+ private long getDataTime(Object object) {
Review Comment:
maybe change to Object data to make more sense
--
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: commits-unsubscribe@inlong.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org