-
Notifications
You must be signed in to change notification settings - Fork 50
feat: introduce java.time methods and variables
#1671
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
Changes from 2 commits
3ad5d32
8f4e430
ab5edaa
f66f830
728a6f0
f74d1ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,25 +15,27 @@ | |
| */ | ||
| package com.google.cloud.datastore.models; | ||
|
|
||
| import static com.google.api.gax.util.TimeConversionUtils.toThreetenDuration; | ||
|
|
||
| import com.google.api.core.BetaApi; | ||
| import com.google.api.core.InternalApi; | ||
| import com.google.api.core.ObsoleteApi; | ||
| import com.google.cloud.Structs; | ||
| import com.google.common.base.Objects; | ||
| import java.util.Map; | ||
| import org.threeten.bp.Duration; | ||
|
|
||
| /** Model class for {@link com.google.datastore.v1.ExecutionStats} */ | ||
| @BetaApi | ||
| public class ExecutionStats { | ||
| private final long resultsReturned; | ||
| private final Duration executionDuration; | ||
| private final java.time.Duration executionDuration; | ||
| private final long readOperations; | ||
| private final Map<String, Object> debugStats; | ||
|
|
||
| @InternalApi | ||
| public ExecutionStats(com.google.datastore.v1.ExecutionStats proto) { | ||
| this.resultsReturned = proto.getResultsReturned(); | ||
| this.executionDuration = Duration.ofNanos(proto.getExecutionDuration().getNanos()); | ||
| this.executionDuration = java.time.Duration.ofNanos(proto.getExecutionDuration().getNanos()); | ||
| this.readOperations = proto.getReadOperations(); | ||
| this.debugStats = Structs.asMap(proto.getDebugStats()); | ||
| } | ||
|
|
@@ -51,8 +53,14 @@ public Map<String, Object> getDebugStats() { | |
| return debugStats; | ||
| } | ||
|
|
||
| /** This method is obsolete. Use {@link #getExecutionDurationDuration()} instead. */ | ||
| @ObsoleteApi("Use getExecutionDurationDuration() instead") | ||
| public org.threeten.bp.Duration getExecutionDuration() { | ||
| return toThreetenDuration(getExecutionDurationDuration()); | ||
| } | ||
|
|
||
| /** Returns the total time to execute the query in the backend. */ | ||
| public Duration getExecutionDuration() { | ||
| public java.time.Duration getExecutionDurationDuration() { | ||
|
||
| return executionDuration; | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.