-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Deprecate "network" and enable "networks" stats (remote Docker API 1.21) (branch master) #361
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 all commits
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 |
|---|---|---|
|
|
@@ -2,12 +2,14 @@ | |
|
|
||
| import java.util.Map; | ||
|
|
||
| import javax.annotation.CheckForNull; | ||
|
|
||
| import org.apache.commons.lang.builder.ToStringBuilder; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import com.fasterxml.jackson.annotation.JsonInclude.Include; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
|
||
| /** | ||
| * Representation of a Docker statistics. | ||
|
|
@@ -19,6 +21,17 @@ public class Statistics { | |
| @JsonProperty("read") | ||
| private String read; | ||
|
|
||
| /** | ||
| * @since Docker Remote API 1.21 | ||
| */ | ||
| @CheckForNull | ||
| @JsonProperty("networks") | ||
| private Map<String, Object> networksStats; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add java doc with
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Object under question, doesn't it have some better structure?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds like over naming. Class itself about stats and naming vars with stats tail under question.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Variables are normally named like JSON fields in docker-java. But what about getter? getNetwork()/getNetworks() should return an dedicated object instead of a map, right?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see no specific structure and wrappers for it. Until it just a map
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or do you want create the same analogue as PortBindings?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds like design question. Up to @marcuslinke
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then @marcuslinke should create
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are API breaking changes already in master, so this will not work. We should really consider another branching model...
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @marcuslinke just create new branch based on previous to cc5b11a (hope it has no bad changes before) then @bonigarcia will PR to this branch and you will do 2.1.3 in parallel.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. Done. Created branch 2.x
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PR to branch 2.x in #362 |
||
|
|
||
| /** | ||
| * @deprecated as of Docker Remote API 1.21, replaced by {@link #networksStats} | ||
| */ | ||
| @Deprecated | ||
| @JsonProperty("network") | ||
| private Map<String, Object> networkStats; | ||
|
|
||
|
|
@@ -31,6 +44,18 @@ public class Statistics { | |
| @JsonProperty("cpu_stats") | ||
| private Map<String, Object> cpuStats; | ||
|
|
||
| /** | ||
| * @since Docker Remote API 1.21 | ||
| */ | ||
| @CheckForNull | ||
| public Map<String, Object> getNetworksStats() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Plus add |
||
| return networksStats; | ||
| } | ||
|
|
||
| /** | ||
| * @deprecated as of Docker Remote API 1.21, replaced by {@link #getNetworksStats()} | ||
| */ | ||
| @Deprecated | ||
| public Map<String, Object> getNetworkStats() { | ||
| return networkStats; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plus add
@CheckForNull