Windows: Refactor resources structure

Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: b1220a763c5046efe8caa3e245c84633a29c3684
Component: engine
This commit is contained in:
John Howard
2015-10-05 10:11:10 -07:00
parent e1896c63ba
commit ff22689d64
7 changed files with 56 additions and 40 deletions

View File

@ -7,8 +7,6 @@ import (
"time"
"github.com/docker/docker/pkg/idtools"
// TODO Windows: Factor out ulimit
"github.com/docker/docker/pkg/ulimit"
"github.com/opencontainers/runc/libcontainer"
"github.com/opencontainers/runc/libcontainer/configs"
)
@ -138,23 +136,13 @@ type UTS struct {
HostUTS bool `json:"host_uts"`
}
// Resources contains all resource configs for a driver.
// Currently these are all for cgroup configs.
// TODO Windows: Factor out ulimit.Rlimit
type Resources struct {
Memory int64 `json:"memory"`
MemorySwap int64 `json:"memory_swap"`
MemoryReservation int64 `json:"memory_reservation"`
KernelMemory int64 `json:"kernel_memory"`
CPUShares int64 `json:"cpu_shares"`
CpusetCpus string `json:"cpuset_cpus"`
CpusetMems string `json:"cpuset_mems"`
CPUPeriod int64 `json:"cpu_period"`
CPUQuota int64 `json:"cpu_quota"`
BlkioWeight uint16 `json:"blkio_weight"`
Rlimits []*ulimit.Rlimit `json:"rlimits"`
OomKillDisable bool `json:"oom_kill_disable"`
MemorySwappiness int64 `json:"memory_swappiness"`
// CommonResources contains the resource configs for a driver that are
// common across platforms.
type CommonResources struct {
Memory int64 `json:"memory"`
MemoryReservation int64 `json:"memory_reservation"`
CPUShares int64 `json:"cpu_shares"`
BlkioWeight uint16 `json:"blkio_weight"`
}
// ResourceStats contains information about resource usage by a container.