This is an automated email from the ASF dual-hosted git repository. rhauch pushed a commit to branch 3.1 in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/3.1 by this push: new 3c2dab1 Revert "MINOR: Remove redundant argument from TaskMetricsGroup#recordCommit (#9642)" 3c2dab1 is described below commit 3c2dab10c0f7f3cd3ff24f3e4c116d9b7755d38e Author: Randall Hauch <rha...@gmail.com> AuthorDate: Tue Nov 16 09:52:48 2021 -0600 Revert "MINOR: Remove redundant argument from TaskMetricsGroup#recordCommit (#9642)" This reverts commit 047ad654da7903f3903760b0e6a6a58648ca7715. --- .../main/java/org/apache/kafka/connect/runtime/WorkerTask.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerTask.java b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerTask.java index e41b061..0d893f5 100644 --- a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerTask.java +++ b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerTask.java @@ -307,7 +307,7 @@ abstract class WorkerTask implements Runnable { * @param duration the length of time in milliseconds for the commit attempt to complete */ protected void recordCommitSuccess(long duration) { - taskMetricsGroup.recordCommit(duration, null); + taskMetricsGroup.recordCommit(duration, true, null); } /** @@ -317,7 +317,7 @@ abstract class WorkerTask implements Runnable { * @param error the unexpected error that occurred; may be null in the case of timeouts or interruptions */ protected void recordCommitFailure(long duration, Throwable error) { - taskMetricsGroup.recordCommit(duration, error); + taskMetricsGroup.recordCommit(duration, false, error); } /** @@ -387,8 +387,8 @@ abstract class WorkerTask implements Runnable { metricGroup.close(); } - void recordCommit(long duration, Throwable error) { - if (error == null) { + void recordCommit(long duration, boolean success, Throwable error) { + if (success) { commitTime.record(duration); commitAttempts.record(1.0d); } else {