Skip to content

Commit

Permalink
MINOR: add units to metrics descriptions + test fix post KAFKA-13229 (a…
Browse files Browse the repository at this point in the history
…pache#11286)

Reviewers: Guozhang Wang <wangguoz@gmail.com>
  • Loading branch information
rodesai authored and Ralph Debusmann committed Dec 22, 2021
1 parent ac89b59 commit f16aac6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ public KafkaProducerMetrics(Metrics metrics) {
);
sendOffsetsSensor = newLatencySensor(
TXN_SEND_OFFSETS,
"Total time producer has spent in sendOffsetsToTransaction."
"Total time producer has spent in sendOffsetsToTransaction in nanoseconds."
);
commitTxnSensor = newLatencySensor(
TXN_COMMIT,
"Total time producer has spent in commitTransaction."
"Total time producer has spent in commitTransaction in nanoseconds."
);
abortTxnSensor = newLatencySensor(
TXN_ABORT,
"Total time producer has spent in abortTransaction."
"Total time producer has spent in abortTransaction in nanoseconds."
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ private void assertDurationAtLeast(KafkaProducer<?, ?> producer, String name, do

private double getAndAssertDurationAtLeast(KafkaProducer<?, ?> producer, String name, double floor) {
double value = getMetricValue(producer, name);
assertTrue(value > floor);
assertTrue(value >= floor);
return value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private ThreadMetrics() {}
private static final String COMMIT_RATIO_DESCRIPTION =
"The fraction of time the thread spent on committing all tasks";
private static final String BLOCKED_TIME_DESCRIPTION =
"The total time the thread spent blocked on kafka";
"The total time the thread spent blocked on kafka in nanoseconds";
private static final String THREAD_START_TIME_DESCRIPTION =
"The time that the thread was started";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public void shouldAddTotalBlockedTimeMetric() {
final ArgumentCaptor<Gauge<Double>> captor = gaugeCaptor();
verify(streamsMetrics).addThreadLevelMutableMetric(
eq("blocked-time-ns-total"),
eq("The total time the thread spent blocked on kafka"),
eq("The total time the thread spent blocked on kafka in nanoseconds"),
eq("burger"),
captor.capture()
);
Expand Down

0 comments on commit f16aac6

Please sign in to comment.