Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add units to metrics descriptions + test fix #11286

Merged
merged 2 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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