|
16 | 16 |
|
17 | 17 | package com.google.cloud.logging; |
18 | 18 |
|
| 19 | +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; |
| 20 | + |
19 | 21 | import com.google.api.core.ApiFunction; |
20 | 22 | import com.google.cloud.StringEnumType; |
21 | 23 | import com.google.cloud.StringEnumValue; |
22 | 24 | import com.google.common.base.MoreObjects; |
23 | 25 | import com.google.errorprone.annotations.CanIgnoreReturnValue; |
24 | 26 | import java.io.Serializable; |
25 | 27 | import java.util.Objects; |
26 | | -import org.threeten.bp.Duration; |
27 | 28 |
|
28 | 29 | /** |
29 | 30 | * Objects of this class represent information about the (optional) HTTP request associated with a |
@@ -51,7 +52,7 @@ public final class HttpRequest implements Serializable { |
51 | 52 | private final boolean cacheHit; |
52 | 53 | private final boolean cacheValidatedWithOriginServer; |
53 | 54 | private final Long cacheFillBytes; |
54 | | - private final Duration latency; |
| 55 | + private final java.time.Duration latency; |
55 | 56 |
|
56 | 57 | /** The HTTP request method. */ |
57 | 58 | public static final class RequestMethod extends StringEnumValue { |
@@ -112,7 +113,7 @@ public static final class Builder { |
112 | 113 | private boolean cacheHit; |
113 | 114 | private boolean cacheValidatedWithOriginServer; |
114 | 115 | private Long cacheFillBytes; |
115 | | - private Duration latency; |
| 116 | + private java.time.Duration latency; |
116 | 117 |
|
117 | 118 | Builder() {} |
118 | 119 |
|
@@ -258,12 +259,19 @@ public Builder setCacheFillBytes(long cacheFillBytes) { |
258 | 259 | return this; |
259 | 260 | } |
260 | 261 |
|
| 262 | + /** |
| 263 | + * This method |
| 264 | + */ |
| 265 | + public Builder setLatency(org.threeten.bp.Duration latency) { |
| 266 | + return setLatencyDuration(toJavaTimeDuration(latency)); |
| 267 | + } |
| 268 | + |
261 | 269 | /** |
262 | 270 | * Sets the latency on the server, from the time the request was received until the response was |
263 | 271 | * sent. |
264 | 272 | */ |
265 | 273 | @CanIgnoreReturnValue |
266 | | - public Builder setLatency(Duration latency) { |
| 274 | + public Builder setLatencyDuration(java.time.Duration latency) { |
267 | 275 | this.latency = latency; |
268 | 276 | return this; |
269 | 277 | } |
|
0 commit comments