1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/cli/command/formatter
Boaz Shuster 929a77b814 Hide the mutex in formatter.ContainerStats
The formatter.ContainerStats struct exposes its Mutex.
This is a bad design and should be fixed.

To fix that, I separated the statistics
attributes from ContainerStats to StatsEntry and
hid the mutex. Notice that the mutex protects both
the `err` field and the statistics attributes.

Then, implemented SetStatistics, SetError, GetStatistics
and GetError to avoid races.

Moreover, to make this less granular, I decided to
replace the read-write mutex with the regular mutex and
to pass a StatsEntry slice to formatter.ContainerStatsWrite

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2016-10-10 21:52:53 +03:00
..
container.go Fix testcases that expect trailing whitespace 2016-09-13 17:58:12 -04:00
container_test.go Refactor formatter. 2016-09-13 17:58:12 -04:00
custom.go Refactor formatter. 2016-09-13 17:58:12 -04:00
custom_test.go Move api/client -> cli/command 2016-09-08 15:46:29 -04:00
formatter.go Add formatter for service inspect 2016-09-19 16:28:19 -04:00
image.go Refactor formatter. 2016-09-13 17:58:12 -04:00
image_test.go Refactor formatter. 2016-09-13 17:58:12 -04:00
network.go Refactor formatter. 2016-09-13 17:58:12 -04:00
network_test.go Refactor formatter. 2016-09-13 17:58:12 -04:00
service.go Add formatter for service inspect 2016-09-19 16:28:19 -04:00
stats.go Hide the mutex in formatter.ContainerStats 2016-10-10 21:52:53 +03:00
volume.go Fix testcases that expect trailing whitespace 2016-09-13 17:58:12 -04:00
volume_test.go Fix testcases that expect trailing whitespace 2016-09-13 17:58:12 -04:00