-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Eliminate redundant getContainers/inspectContainer calls
Both the initial container scan and each update called getContainers() once and inspectContainer() twice (!!). But this is very redundant: The objects returned by getContainers() and inspectContainer() have a very similar structure. The latter does not have `Pid` and `PodName`, but we don't use these properties anyway. The others map in a straightforward way: * `Names[]` → single `Name` * `Ports` list → `NetworkSettings.Ports` map * `Mounts` (simple target dir list) → list of objects with lots of info; direct translation is `.Destination` * `Started/Exited...At` → `State.*` * `State` → `State.Status` * `Command` → `Config.Cmd` * `Labels` → `Config.Labels` * `ImageID` → `Image` * `Image` → `ImageName` So change the state keeping to call getContainers() only once at initialization, and from then on only a single inspectContainer() for each state update. Adjust the code for the above property structure changes.
- Loading branch information
1 parent
b15258e
commit d59c3ba
Showing
14 changed files
with
146 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.