|
18 | 18 |
|
19 | 19 | import static com.google.common.truth.Truth.assertThat; |
20 | 20 |
|
| 21 | +import io.opencensus.stats.Measure; |
21 | 22 | import org.junit.Test; |
22 | 23 | import org.junit.runner.RunWith; |
23 | 24 | import org.junit.runners.JUnit4; |
@@ -57,9 +58,22 @@ public void testConstants() { |
57 | 58 | assertThat(RpcMeasureConstants.GRPC_CLIENT_SERVER_LATENCY).isNotNull(); |
58 | 59 | assertThat(RpcMeasureConstants.GRPC_CLIENT_ROUNDTRIP_LATENCY).isNotNull(); |
59 | 60 | assertThat(RpcMeasureConstants.GRPC_CLIENT_STARTED_RPCS).isNotNull(); |
60 | | - assertThat(RpcMeasureConstants.GRPC_CLIENT_RETRIES_PER_CALL).isNotNull(); |
61 | | - assertThat(RpcMeasureConstants.GRPC_CLIENT_TRANSPARENT_RETRIES_PER_CALL).isNotNull(); |
62 | | - assertThat(RpcMeasureConstants.GRPC_CLIENT_RETRY_DELAY_PER_CALL).isNotNull(); |
| 61 | + |
| 62 | + // Test client retry measurement descriptors. |
| 63 | + assertThat(RpcMeasureConstants.GRPC_CLIENT_RETRIES_PER_CALL) |
| 64 | + .isEqualTo( |
| 65 | + Measure.MeasureLong.create( |
| 66 | + "grpc.io/client/retries_per_call", "Number of retries per call", "1")); |
| 67 | + assertThat(RpcMeasureConstants.GRPC_CLIENT_TRANSPARENT_RETRIES_PER_CALL) |
| 68 | + .isEqualTo( |
| 69 | + Measure.MeasureLong.create( |
| 70 | + "grpc.io/client/transparent_retries_per_call", |
| 71 | + "Transparent retries per call", |
| 72 | + "1")); |
| 73 | + assertThat(RpcMeasureConstants.GRPC_CLIENT_RETRY_DELAY_PER_CALL) |
| 74 | + .isEqualTo( |
| 75 | + Measure.MeasureDouble.create( |
| 76 | + "grpc.io/client/retry_delay_per_call", "Retry delay per call", "ms")); |
63 | 77 |
|
64 | 78 | // Test server measurement descriptors. |
65 | 79 | assertThat(RpcMeasureConstants.RPC_SERVER_ERROR_COUNT).isNotNull(); |
|
0 commit comments