Fix time units in HTTP & RPC metrics (#4963)

This commit is contained in:
Mateusz Rzeszutek 2021-12-21 20:51:57 +01:00 committed by GitHub
parent 88121c1583
commit 0fd7b8baa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 10 additions and 4 deletions

View File

@ -54,7 +54,7 @@ public final class HttpClientMetrics implements RequestListener {
duration =
meter
.histogramBuilder("http.client.duration")
.setUnit("milliseconds")
.setUnit("ms")
.setDescription("The duration of the outbound HTTP request")
.build();
}

View File

@ -64,7 +64,7 @@ public final class HttpServerMetrics implements RequestListener {
duration =
meter
.histogramBuilder("http.server.duration")
.setUnit("milliseconds")
.setUnit("ms")
.setDescription("The duration of the inbound HTTP request")
.build();
}

View File

@ -45,7 +45,7 @@ public final class RpcClientMetrics implements RequestListener {
meter
.histogramBuilder("rpc.client.duration")
.setDescription("The duration of an outbound RPC invocation")
.setUnit("milliseconds")
.setUnit("ms")
.build();
}

View File

@ -45,7 +45,7 @@ public final class RpcServerMetrics implements RequestListener {
meter
.histogramBuilder("rpc.server.duration")
.setDescription("The duration of an inbound RPC invocation")
.setUnit("milliseconds")
.setUnit("ms")
.build();
}

View File

@ -93,6 +93,7 @@ class HttpClientMetricsTest {
metric ->
assertThat(metric)
.hasName("http.client.duration")
.hasUnit("ms")
.hasDoubleHistogram()
.points()
.satisfiesExactly(

View File

@ -132,6 +132,7 @@ class HttpServerMetricsTest {
metric ->
assertThat(metric)
.hasName("http.server.duration")
.hasUnit("ms")
.hasDoubleHistogram()
.points()
.satisfiesExactly(

View File

@ -99,6 +99,7 @@ class RpcClientMetricsTest {
metric ->
MetricAssertions.assertThat(metric)
.hasName("rpc.client.duration")
.hasUnit("ms")
.hasDoubleHistogram()
.points()
.satisfiesExactly(
@ -132,6 +133,7 @@ class RpcClientMetricsTest {
metric ->
MetricAssertions.assertThat(metric)
.hasName("rpc.client.duration")
.hasUnit("ms")
.hasDoubleHistogram()
.points()
.satisfiesExactly(

View File

@ -99,6 +99,7 @@ class RpcServerMetricsTest {
metric ->
MetricAssertions.assertThat(metric)
.hasName("rpc.server.duration")
.hasUnit("ms")
.hasDoubleHistogram()
.points()
.satisfiesExactly(
@ -131,6 +132,7 @@ class RpcServerMetricsTest {
metric ->
MetricAssertions.assertThat(metric)
.hasName("rpc.server.duration")
.hasUnit("ms")
.hasDoubleHistogram()
.points()
.satisfiesExactly(