tsreaper commented on code in PR #1739:
URL: https://github.com/apache/incubator-paimon/pull/1739#discussion_r1286624345
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink/StoreCommitter.java:
##########
@@ -83,4 +88,22 @@ public Map<Long, List<Committable>>
groupByCheckpoint(Collection<Committable> co
public void close() throws Exception {
commit.close();
}
+
+ @VisibleForTesting
+ static long calcDataBytesSend(List<ManifestCommittable> committables) {
+ long bytesSend = 0;
+ for (ManifestCommittable committable : committables) {
+ List<CommitMessage> commitMessages =
committable.fileCommittables();
+ for (CommitMessage commitMessage : commitMessages) {
+ long dataFileSizeInc =
+ ((CommitMessageImpl) commitMessage)
+ .newFilesIncrement().newFiles().stream()
Review Comment:
Compact files and changelogs should also be calculated.
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink/StoreCommitter.java:
##########
@@ -60,8 +64,9 @@ public ManifestCommittable combine(
}
@Override
- public void commit(List<ManifestCommittable> committables)
+ public void commit(List<ManifestCommittable> committables,
OperatorIOMetricGroup metricGroup)
throws IOException, InterruptedException {
+
metricGroup.getNumBytesOutCounter().inc(calcDataBytesSend(committables));
Review Comment:
Count this only after the commit is successful. Otherwise if the commit is
retried through fail over, this will be counted multiple times.
--
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]