diff --git a/Gopkg.lock b/Gopkg.lock index 08118a215f..ef60c1e30b 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -99,7 +99,7 @@ "protocols/client", "protocols/grpc" ] - revision = "04d58dd248a36404c33c9d12c499c60f1828060b" + revision = "ea0e6ae4862c8af0b2d10eb6c074682fd676016a" [[projects]] name = "github.com/kubernetes-incubator/cri-o" @@ -263,6 +263,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "976f719dc5f3fd1a56eb21237161c89b7f499a14e4b0638bc358698d4e0dbf8f" + inputs-digest = "cb04b7652592ba04799fda27eb1f6d2034b5d669e1c82665d223fb004d676652" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index f9f0b373f8..d67de1f7b5 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -60,7 +60,7 @@ [[constraint]] name = "github.com/kata-containers/agent" - revision = "04d58dd248a36404c33c9d12c499c60f1828060b" + revision = "ea0e6ae4862c8af0b2d10eb6c074682fd676016a" [[constraint]] name = "github.com/containerd/cri-containerd" diff --git a/cli/events.go b/cli/events.go new file mode 100644 index 0000000000..553ab0f1ca --- /dev/null +++ b/cli/events.go @@ -0,0 +1,270 @@ +// Copyright (c) 2014,2015,2016,2017 Docker, Inc. +// Copyright (c) 2018 Huawei Corporation. +// +// SPDX-License-Identifier: Apache-2.0 +// + +package main + +import ( + "encoding/json" + "fmt" + "os" + "sync" + "time" + + vc "github.com/kata-containers/runtime/virtcontainers" + + "github.com/sirupsen/logrus" + "github.com/urfave/cli" +) + +type event struct { + Type string `json:"type"` + ID string `json:"id"` + Data interface{} `json:"data,omitempty"` +} + +// stats is the runc specific stats structure for stability when encoding and decoding stats. +type stats struct { + CPU cpu `json:"cpu"` + Memory memory `json:"memory"` + Pids pids `json:"pids"` + Blkio blkio `json:"blkio"` + Hugetlb map[string]hugetlb `json:"hugetlb"` + IntelRdt intelRdt `json:"intel_rdt"` +} + +type hugetlb struct { + Usage uint64 `json:"usage,omitempty"` + Max uint64 `json:"max,omitempty"` + Failcnt uint64 `json:"failcnt"` +} + +type blkioEntry struct { + Major uint64 `json:"major,omitempty"` + Minor uint64 `json:"minor,omitempty"` + Op string `json:"op,omitempty"` + Value uint64 `json:"value,omitempty"` +} + +type blkio struct { + IoServiceBytesRecursive []blkioEntry `json:"ioServiceBytesRecursive,omitempty"` + IoServicedRecursive []blkioEntry `json:"ioServicedRecursive,omitempty"` + IoQueuedRecursive []blkioEntry `json:"ioQueueRecursive,omitempty"` + IoServiceTimeRecursive []blkioEntry `json:"ioServiceTimeRecursive,omitempty"` + IoWaitTimeRecursive []blkioEntry `json:"ioWaitTimeRecursive,omitempty"` + IoMergedRecursive []blkioEntry `json:"ioMergedRecursive,omitempty"` + IoTimeRecursive []blkioEntry `json:"ioTimeRecursive,omitempty"` + SectorsRecursive []blkioEntry `json:"sectorsRecursive,omitempty"` +} + +type pids struct { + Current uint64 `json:"current,omitempty"` + Limit uint64 `json:"limit,omitempty"` +} + +type throttling struct { + Periods uint64 `json:"periods,omitempty"` + ThrottledPeriods uint64 `json:"throttledPeriods,omitempty"` + ThrottledTime uint64 `json:"throttledTime,omitempty"` +} + +type cpuUsage struct { + // Units: nanoseconds. + Total uint64 `json:"total,omitempty"` + Percpu []uint64 `json:"percpu,omitempty"` + Kernel uint64 `json:"kernel"` + User uint64 `json:"user"` +} + +type cpu struct { + Usage cpuUsage `json:"usage,omitempty"` + Throttling throttling `json:"throttling,omitempty"` +} + +type memoryEntry struct { + Limit uint64 `json:"limit"` + Usage uint64 `json:"usage,omitempty"` + Max uint64 `json:"max,omitempty"` + Failcnt uint64 `json:"failcnt"` +} + +type memory struct { + Cache uint64 `json:"cache,omitempty"` + Usage memoryEntry `json:"usage,omitempty"` + Swap memoryEntry `json:"swap,omitempty"` + Kernel memoryEntry `json:"kernel,omitempty"` + KernelTCP memoryEntry `json:"kernelTCP,omitempty"` + Raw map[string]uint64 `json:"raw,omitempty"` +} + +type l3CacheInfo struct { + CbmMask string `json:"cbm_mask,omitempty"` + MinCbmBits uint64 `json:"min_cbm_bits,omitempty"` + NumClosids uint64 `json:"num_closids,omitempty"` +} + +type intelRdt struct { + // The read-only L3 cache information + L3CacheInfo *l3CacheInfo `json:"l3_cache_info,omitempty"` + + // The read-only L3 cache schema in root + L3CacheSchemaRoot string `json:"l3_cache_schema_root,omitempty"` + + // The L3 cache schema in 'container_id' group + L3CacheSchema string `json:"l3_cache_schema,omitempty"` +} + +var eventsCLICommand = cli.Command{ + Name: "events", + Usage: "display container events such as OOM notifications, cpu, memory, and IO usage statistics", + ArgsUsage: ` + +Where "" is the name for the instance of the container.`, + Description: `The events command displays information about the container. By default the +information is displayed once every 5 seconds.`, + Flags: []cli.Flag{ + cli.DurationFlag{ + Name: "interval", + Value: 5 * time.Second, + Usage: "set the stats collection interval", + }, + cli.BoolFlag{ + Name: "stats", + Usage: "display the container's stats then exit", + }, + }, + Action: func(context *cli.Context) error { + containerID := context.Args().First() + if containerID == "" { + return fmt.Errorf("container id cannot be empty") + } + + duration := context.Duration("interval") + if duration <= 0 { + return fmt.Errorf("duration interval must be greater than 0") + } + + status, sandboxID, err := getExistingContainerInfo(containerID) + if err != nil { + return err + } + + if status.State.State == vc.StateStopped { + return fmt.Errorf("container with id %s is not running", status.ID) + } + + var ( + events = make(chan *event, 1024) + group = &sync.WaitGroup{} + ) + group.Add(1) + + go func() { + defer group.Done() + enc := json.NewEncoder(os.Stdout) + for e := range events { + if err := enc.Encode(e); err != nil { + logrus.Error(err) + } + } + }() + + if context.Bool("stats") { + s, err := vci.StatsContainer(sandboxID, containerID) + if err != nil { + return err + } + events <- &event{Type: "stats", ID: status.ID, Data: convertVirtcontainerStats(&s)} + close(events) + group.Wait() + return nil + } + + go func() { + for range time.Tick(context.Duration("interval")) { + s, err := vci.StatsContainer(sandboxID, containerID) + if err != nil { + logrus.Error(err) + continue + } + events <- &event{Type: "stats", ID: status.ID, Data: convertVirtcontainerStats(&s)} + } + }() + + group.Wait() + return nil + }, +} + +func convertVirtcontainerStats(containerStats *vc.ContainerStats) *stats { + cg := containerStats.CgroupStats + if cg == nil { + return nil + } + var s stats + s.Pids.Current = cg.PidsStats.Current + s.Pids.Limit = cg.PidsStats.Limit + + s.CPU.Usage.Kernel = cg.CPUStats.CPUUsage.UsageInKernelmode + s.CPU.Usage.User = cg.CPUStats.CPUUsage.UsageInUsermode + s.CPU.Usage.Total = cg.CPUStats.CPUUsage.TotalUsage + s.CPU.Usage.Percpu = cg.CPUStats.CPUUsage.PercpuUsage + s.CPU.Throttling.Periods = cg.CPUStats.ThrottlingData.Periods + s.CPU.Throttling.ThrottledPeriods = cg.CPUStats.ThrottlingData.ThrottledPeriods + s.CPU.Throttling.ThrottledTime = cg.CPUStats.ThrottlingData.ThrottledTime + + s.Memory.Cache = cg.MemoryStats.Cache + s.Memory.Kernel = convertMemoryEntry(cg.MemoryStats.KernelUsage) + s.Memory.KernelTCP = convertMemoryEntry(cg.MemoryStats.KernelTCPUsage) + s.Memory.Swap = convertMemoryEntry(cg.MemoryStats.SwapUsage) + s.Memory.Usage = convertMemoryEntry(cg.MemoryStats.Usage) + s.Memory.Raw = cg.MemoryStats.Stats + + s.Blkio.IoServiceBytesRecursive = convertBlkioEntry(cg.BlkioStats.IoServiceBytesRecursive) + s.Blkio.IoServicedRecursive = convertBlkioEntry(cg.BlkioStats.IoServicedRecursive) + s.Blkio.IoQueuedRecursive = convertBlkioEntry(cg.BlkioStats.IoQueuedRecursive) + s.Blkio.IoServiceTimeRecursive = convertBlkioEntry(cg.BlkioStats.IoServiceTimeRecursive) + s.Blkio.IoWaitTimeRecursive = convertBlkioEntry(cg.BlkioStats.IoWaitTimeRecursive) + s.Blkio.IoMergedRecursive = convertBlkioEntry(cg.BlkioStats.IoMergedRecursive) + s.Blkio.IoTimeRecursive = convertBlkioEntry(cg.BlkioStats.IoTimeRecursive) + s.Blkio.SectorsRecursive = convertBlkioEntry(cg.BlkioStats.SectorsRecursive) + + s.Hugetlb = make(map[string]hugetlb) + for k, v := range cg.HugetlbStats { + s.Hugetlb[k] = convertHugtlb(v) + } + + return &s +} + +func convertHugtlb(c vc.HugetlbStats) hugetlb { + return hugetlb{ + Usage: c.Usage, + Max: c.MaxUsage, + Failcnt: c.Failcnt, + } +} + +func convertMemoryEntry(c vc.MemoryData) memoryEntry { + return memoryEntry{ + Limit: c.Limit, + Usage: c.Usage, + Max: c.MaxUsage, + Failcnt: c.Failcnt, + } +} + +func convertBlkioEntry(c []vc.BlkioStatEntry) []blkioEntry { + var out []blkioEntry + for _, e := range c { + out = append(out, blkioEntry{ + Major: e.Major, + Minor: e.Minor, + Op: e.Op, + Value: e.Value, + }) + } + return out +} diff --git a/cli/events_test.go b/cli/events_test.go new file mode 100644 index 0000000000..315b268606 --- /dev/null +++ b/cli/events_test.go @@ -0,0 +1,141 @@ +// Copyright (c) 2018 Huawei Corporation. +// +// SPDX-License-Identifier: Apache-2.0 +// + +package main + +import ( + "flag" + "os" + "testing" + "time" + + vc "github.com/kata-containers/runtime/virtcontainers" + vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations" + "github.com/kata-containers/runtime/virtcontainers/pkg/vcmock" + "github.com/stretchr/testify/assert" + "github.com/urfave/cli" +) + +func TestEventsCliAction(t *testing.T) { + assert := assert.New(t) + + // get Action function + actionFunc, ok := eventsCLICommand.Action.(func(ctx *cli.Context) error) + flagSet := flag.NewFlagSet("events", flag.ContinueOnError) + + // create a new fake context + ctx := cli.NewContext(&cli.App{}, flagSet, nil) + assert.True(ok) + + err := actionFunc(ctx) + assert.Error(err, "Missing container ID") +} + +func TestEventsCLIFailure(t *testing.T) { + assert := assert.New(t) + + flagSet := flag.NewFlagSet("events", flag.ContinueOnError) + ctx := cli.NewContext(&cli.App{}, flagSet, nil) + + actionFunc, ok := eventsCLICommand.Action.(func(ctx *cli.Context) error) + assert.True(ok) + + // missing container ID + err := actionFunc(ctx) + assert.Error(err) + + // interval is negative + flagSet.Parse([]string{testContainerID}) + flagSet.Duration("interval", (-1)*time.Second, "") + ctx = cli.NewContext(&cli.App{}, flagSet, nil) + err = actionFunc(ctx) + assert.Error(err) + + // interval is zero + flagSet = flag.NewFlagSet("events", flag.ContinueOnError) + flagSet.Parse([]string{testContainerID}) + flagSet.Duration("interval", 0*time.Second, "") + ctx = cli.NewContext(&cli.App{}, flagSet, nil) + err = actionFunc(ctx) + assert.Error(err) + + // not running + sandbox := &vcmock.Sandbox{ + MockID: testContainerID, + } + + sandbox.MockContainers = []*vcmock.Container{ + { + MockID: sandbox.ID(), + MockSandbox: sandbox, + }, + } + + testingImpl.StatusContainerFunc = func(sandboxID, containerID string) (vc.ContainerStatus, error) { + return vc.ContainerStatus{ + ID: sandbox.ID(), + Annotations: map[string]string{ + vcAnnotations.ContainerTypeKey: string(vc.PodContainer), + }, + }, nil + } + + defer func() { + testingImpl.StatusContainerFunc = nil + }() + err = actionFunc(ctx) + assert.Error(err) +} + +func TestEventsCLISuccessful(t *testing.T) { + assert := assert.New(t) + + sandbox := &vcmock.Sandbox{ + MockID: testContainerID, + } + + sandbox.MockContainers = []*vcmock.Container{ + { + MockID: sandbox.ID(), + MockSandbox: sandbox, + }, + } + + testingImpl.StatusContainerFunc = func(sandboxID, containerID string) (vc.ContainerStatus, error) { + return vc.ContainerStatus{ + ID: sandbox.ID(), + Annotations: map[string]string{ + vcAnnotations.ContainerTypeKey: string(vc.PodContainer), + }, + State: vc.State{ + State: vc.StateRunning, + }, + }, nil + } + + testingImpl.StatsContainerFunc = func(sandboxID, containerID string) (vc.ContainerStats, error) { + return vc.ContainerStats{}, nil + } + + defer func() { + testingImpl.StatusContainerFunc = nil + testingImpl.StatsContainerFunc = nil + }() + + path, err := createTempContainerIDMapping(sandbox.ID(), sandbox.ID()) + assert.NoError(err) + defer os.RemoveAll(path) + + actionFunc, ok := eventsCLICommand.Action.(func(ctx *cli.Context) error) + assert.True(ok) + + flagSet := flag.NewFlagSet("events", flag.ContinueOnError) + flagSet.Parse([]string{testContainerID}) + flagSet.Duration("interval", 5*time.Second, "") + flagSet.Bool("stats", true, "") + ctx := cli.NewContext(&cli.App{}, flagSet, nil) + err = actionFunc(ctx) + assert.NoError(err) +} diff --git a/cli/main.go b/cli/main.go index b84d6fff19..e5b7f61e25 100644 --- a/cli/main.go +++ b/cli/main.go @@ -117,6 +117,7 @@ var runtimeCommands = []cli.Command{ startCLICommand, stateCLICommand, updateCLICommand, + eventsCLICommand, versionCLICommand, // Kata Containers specific extensions diff --git a/vendor/github.com/kata-containers/agent/protocols/grpc/agent.pb.go b/vendor/github.com/kata-containers/agent/protocols/grpc/agent.pb.go index f4a4e17520..7938de3d2c 100644 --- a/vendor/github.com/kata-containers/agent/protocols/grpc/agent.pb.go +++ b/vendor/github.com/kata-containers/agent/protocols/grpc/agent.pb.go @@ -20,6 +20,18 @@ ListProcessesRequest ListProcessesResponse UpdateContainerRequest + StatsContainerRequest + CpuUsage + ThrottlingData + CpuStats + PidsStats + MemoryData + MemoryStats + BlkioStatsEntry + BlkioStats + HugetlbStats + CgroupStats + StatsContainerResponse WriteStreamRequest WriteStreamResponse ReadStreamRequest @@ -409,6 +421,446 @@ func (m *UpdateContainerRequest) GetResources() *LinuxResources { return nil } +type StatsContainerRequest struct { + ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` +} + +func (m *StatsContainerRequest) Reset() { *m = StatsContainerRequest{} } +func (m *StatsContainerRequest) String() string { return proto.CompactTextString(m) } +func (*StatsContainerRequest) ProtoMessage() {} +func (*StatsContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{10} } + +func (m *StatsContainerRequest) GetContainerId() string { + if m != nil { + return m.ContainerId + } + return "" +} + +type CpuUsage struct { + TotalUsage uint64 `protobuf:"varint,1,opt,name=total_usage,json=totalUsage,proto3" json:"total_usage,omitempty"` + PercpuUsage []uint64 `protobuf:"varint,2,rep,packed,name=percpu_usage,json=percpuUsage" json:"percpu_usage,omitempty"` + UsageInKernelmode uint64 `protobuf:"varint,3,opt,name=usage_in_kernelmode,json=usageInKernelmode,proto3" json:"usage_in_kernelmode,omitempty"` + UsageInUsermode uint64 `protobuf:"varint,4,opt,name=usage_in_usermode,json=usageInUsermode,proto3" json:"usage_in_usermode,omitempty"` +} + +func (m *CpuUsage) Reset() { *m = CpuUsage{} } +func (m *CpuUsage) String() string { return proto.CompactTextString(m) } +func (*CpuUsage) ProtoMessage() {} +func (*CpuUsage) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{11} } + +func (m *CpuUsage) GetTotalUsage() uint64 { + if m != nil { + return m.TotalUsage + } + return 0 +} + +func (m *CpuUsage) GetPercpuUsage() []uint64 { + if m != nil { + return m.PercpuUsage + } + return nil +} + +func (m *CpuUsage) GetUsageInKernelmode() uint64 { + if m != nil { + return m.UsageInKernelmode + } + return 0 +} + +func (m *CpuUsage) GetUsageInUsermode() uint64 { + if m != nil { + return m.UsageInUsermode + } + return 0 +} + +type ThrottlingData struct { + Periods uint64 `protobuf:"varint,1,opt,name=periods,proto3" json:"periods,omitempty"` + ThrottledPeriods uint64 `protobuf:"varint,2,opt,name=throttled_periods,json=throttledPeriods,proto3" json:"throttled_periods,omitempty"` + ThrottledTime uint64 `protobuf:"varint,3,opt,name=throttled_time,json=throttledTime,proto3" json:"throttled_time,omitempty"` +} + +func (m *ThrottlingData) Reset() { *m = ThrottlingData{} } +func (m *ThrottlingData) String() string { return proto.CompactTextString(m) } +func (*ThrottlingData) ProtoMessage() {} +func (*ThrottlingData) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{12} } + +func (m *ThrottlingData) GetPeriods() uint64 { + if m != nil { + return m.Periods + } + return 0 +} + +func (m *ThrottlingData) GetThrottledPeriods() uint64 { + if m != nil { + return m.ThrottledPeriods + } + return 0 +} + +func (m *ThrottlingData) GetThrottledTime() uint64 { + if m != nil { + return m.ThrottledTime + } + return 0 +} + +type CpuStats struct { + CpuUsage *CpuUsage `protobuf:"bytes,1,opt,name=cpu_usage,json=cpuUsage" json:"cpu_usage,omitempty"` + ThrottlingData *ThrottlingData `protobuf:"bytes,2,opt,name=throttling_data,json=throttlingData" json:"throttling_data,omitempty"` +} + +func (m *CpuStats) Reset() { *m = CpuStats{} } +func (m *CpuStats) String() string { return proto.CompactTextString(m) } +func (*CpuStats) ProtoMessage() {} +func (*CpuStats) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{13} } + +func (m *CpuStats) GetCpuUsage() *CpuUsage { + if m != nil { + return m.CpuUsage + } + return nil +} + +func (m *CpuStats) GetThrottlingData() *ThrottlingData { + if m != nil { + return m.ThrottlingData + } + return nil +} + +type PidsStats struct { + Current uint64 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` + Limit uint64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` +} + +func (m *PidsStats) Reset() { *m = PidsStats{} } +func (m *PidsStats) String() string { return proto.CompactTextString(m) } +func (*PidsStats) ProtoMessage() {} +func (*PidsStats) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{14} } + +func (m *PidsStats) GetCurrent() uint64 { + if m != nil { + return m.Current + } + return 0 +} + +func (m *PidsStats) GetLimit() uint64 { + if m != nil { + return m.Limit + } + return 0 +} + +type MemoryData struct { + Usage uint64 `protobuf:"varint,1,opt,name=usage,proto3" json:"usage,omitempty"` + MaxUsage uint64 `protobuf:"varint,2,opt,name=max_usage,json=maxUsage,proto3" json:"max_usage,omitempty"` + Failcnt uint64 `protobuf:"varint,3,opt,name=failcnt,proto3" json:"failcnt,omitempty"` + Limit uint64 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` +} + +func (m *MemoryData) Reset() { *m = MemoryData{} } +func (m *MemoryData) String() string { return proto.CompactTextString(m) } +func (*MemoryData) ProtoMessage() {} +func (*MemoryData) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{15} } + +func (m *MemoryData) GetUsage() uint64 { + if m != nil { + return m.Usage + } + return 0 +} + +func (m *MemoryData) GetMaxUsage() uint64 { + if m != nil { + return m.MaxUsage + } + return 0 +} + +func (m *MemoryData) GetFailcnt() uint64 { + if m != nil { + return m.Failcnt + } + return 0 +} + +func (m *MemoryData) GetLimit() uint64 { + if m != nil { + return m.Limit + } + return 0 +} + +type MemoryStats struct { + Cache uint64 `protobuf:"varint,1,opt,name=cache,proto3" json:"cache,omitempty"` + Usage *MemoryData `protobuf:"bytes,2,opt,name=usage" json:"usage,omitempty"` + SwapUsage *MemoryData `protobuf:"bytes,3,opt,name=swap_usage,json=swapUsage" json:"swap_usage,omitempty"` + KernelUsage *MemoryData `protobuf:"bytes,4,opt,name=kernel_usage,json=kernelUsage" json:"kernel_usage,omitempty"` + UseHierarchy bool `protobuf:"varint,5,opt,name=use_hierarchy,json=useHierarchy,proto3" json:"use_hierarchy,omitempty"` + Stats map[string]uint64 `protobuf:"bytes,6,rep,name=stats" json:"stats,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` +} + +func (m *MemoryStats) Reset() { *m = MemoryStats{} } +func (m *MemoryStats) String() string { return proto.CompactTextString(m) } +func (*MemoryStats) ProtoMessage() {} +func (*MemoryStats) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{16} } + +func (m *MemoryStats) GetCache() uint64 { + if m != nil { + return m.Cache + } + return 0 +} + +func (m *MemoryStats) GetUsage() *MemoryData { + if m != nil { + return m.Usage + } + return nil +} + +func (m *MemoryStats) GetSwapUsage() *MemoryData { + if m != nil { + return m.SwapUsage + } + return nil +} + +func (m *MemoryStats) GetKernelUsage() *MemoryData { + if m != nil { + return m.KernelUsage + } + return nil +} + +func (m *MemoryStats) GetUseHierarchy() bool { + if m != nil { + return m.UseHierarchy + } + return false +} + +func (m *MemoryStats) GetStats() map[string]uint64 { + if m != nil { + return m.Stats + } + return nil +} + +type BlkioStatsEntry struct { + Major uint64 `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"` + Minor uint64 `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"` + Op string `protobuf:"bytes,3,opt,name=op,proto3" json:"op,omitempty"` + Value uint64 `protobuf:"varint,4,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *BlkioStatsEntry) Reset() { *m = BlkioStatsEntry{} } +func (m *BlkioStatsEntry) String() string { return proto.CompactTextString(m) } +func (*BlkioStatsEntry) ProtoMessage() {} +func (*BlkioStatsEntry) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{17} } + +func (m *BlkioStatsEntry) GetMajor() uint64 { + if m != nil { + return m.Major + } + return 0 +} + +func (m *BlkioStatsEntry) GetMinor() uint64 { + if m != nil { + return m.Minor + } + return 0 +} + +func (m *BlkioStatsEntry) GetOp() string { + if m != nil { + return m.Op + } + return "" +} + +func (m *BlkioStatsEntry) GetValue() uint64 { + if m != nil { + return m.Value + } + return 0 +} + +type BlkioStats struct { + IoServiceBytesRecursive []*BlkioStatsEntry `protobuf:"bytes,1,rep,name=io_service_bytes_recursive,json=ioServiceBytesRecursive" json:"io_service_bytes_recursive,omitempty"` + IoServicedRecursive []*BlkioStatsEntry `protobuf:"bytes,2,rep,name=io_serviced_recursive,json=ioServicedRecursive" json:"io_serviced_recursive,omitempty"` + IoQueuedRecursive []*BlkioStatsEntry `protobuf:"bytes,3,rep,name=io_queued_recursive,json=ioQueuedRecursive" json:"io_queued_recursive,omitempty"` + IoServiceTimeRecursive []*BlkioStatsEntry `protobuf:"bytes,4,rep,name=io_service_time_recursive,json=ioServiceTimeRecursive" json:"io_service_time_recursive,omitempty"` + IoWaitTimeRecursive []*BlkioStatsEntry `protobuf:"bytes,5,rep,name=io_wait_time_recursive,json=ioWaitTimeRecursive" json:"io_wait_time_recursive,omitempty"` + IoMergedRecursive []*BlkioStatsEntry `protobuf:"bytes,6,rep,name=io_merged_recursive,json=ioMergedRecursive" json:"io_merged_recursive,omitempty"` + IoTimeRecursive []*BlkioStatsEntry `protobuf:"bytes,7,rep,name=io_time_recursive,json=ioTimeRecursive" json:"io_time_recursive,omitempty"` + SectorsRecursive []*BlkioStatsEntry `protobuf:"bytes,8,rep,name=sectors_recursive,json=sectorsRecursive" json:"sectors_recursive,omitempty"` +} + +func (m *BlkioStats) Reset() { *m = BlkioStats{} } +func (m *BlkioStats) String() string { return proto.CompactTextString(m) } +func (*BlkioStats) ProtoMessage() {} +func (*BlkioStats) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{18} } + +func (m *BlkioStats) GetIoServiceBytesRecursive() []*BlkioStatsEntry { + if m != nil { + return m.IoServiceBytesRecursive + } + return nil +} + +func (m *BlkioStats) GetIoServicedRecursive() []*BlkioStatsEntry { + if m != nil { + return m.IoServicedRecursive + } + return nil +} + +func (m *BlkioStats) GetIoQueuedRecursive() []*BlkioStatsEntry { + if m != nil { + return m.IoQueuedRecursive + } + return nil +} + +func (m *BlkioStats) GetIoServiceTimeRecursive() []*BlkioStatsEntry { + if m != nil { + return m.IoServiceTimeRecursive + } + return nil +} + +func (m *BlkioStats) GetIoWaitTimeRecursive() []*BlkioStatsEntry { + if m != nil { + return m.IoWaitTimeRecursive + } + return nil +} + +func (m *BlkioStats) GetIoMergedRecursive() []*BlkioStatsEntry { + if m != nil { + return m.IoMergedRecursive + } + return nil +} + +func (m *BlkioStats) GetIoTimeRecursive() []*BlkioStatsEntry { + if m != nil { + return m.IoTimeRecursive + } + return nil +} + +func (m *BlkioStats) GetSectorsRecursive() []*BlkioStatsEntry { + if m != nil { + return m.SectorsRecursive + } + return nil +} + +type HugetlbStats struct { + Usage uint64 `protobuf:"varint,1,opt,name=usage,proto3" json:"usage,omitempty"` + MaxUsage uint64 `protobuf:"varint,2,opt,name=max_usage,json=maxUsage,proto3" json:"max_usage,omitempty"` + Failcnt uint64 `protobuf:"varint,3,opt,name=failcnt,proto3" json:"failcnt,omitempty"` +} + +func (m *HugetlbStats) Reset() { *m = HugetlbStats{} } +func (m *HugetlbStats) String() string { return proto.CompactTextString(m) } +func (*HugetlbStats) ProtoMessage() {} +func (*HugetlbStats) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{19} } + +func (m *HugetlbStats) GetUsage() uint64 { + if m != nil { + return m.Usage + } + return 0 +} + +func (m *HugetlbStats) GetMaxUsage() uint64 { + if m != nil { + return m.MaxUsage + } + return 0 +} + +func (m *HugetlbStats) GetFailcnt() uint64 { + if m != nil { + return m.Failcnt + } + return 0 +} + +type CgroupStats struct { + CpuStats *CpuStats `protobuf:"bytes,1,opt,name=cpu_stats,json=cpuStats" json:"cpu_stats,omitempty"` + MemoryStats *MemoryStats `protobuf:"bytes,2,opt,name=memory_stats,json=memoryStats" json:"memory_stats,omitempty"` + PidsStats *PidsStats `protobuf:"bytes,3,opt,name=pids_stats,json=pidsStats" json:"pids_stats,omitempty"` + BlkioStats *BlkioStats `protobuf:"bytes,4,opt,name=blkio_stats,json=blkioStats" json:"blkio_stats,omitempty"` + HugetlbStats map[string]*HugetlbStats `protobuf:"bytes,5,rep,name=hugetlb_stats,json=hugetlbStats" json:"hugetlb_stats,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *CgroupStats) Reset() { *m = CgroupStats{} } +func (m *CgroupStats) String() string { return proto.CompactTextString(m) } +func (*CgroupStats) ProtoMessage() {} +func (*CgroupStats) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{20} } + +func (m *CgroupStats) GetCpuStats() *CpuStats { + if m != nil { + return m.CpuStats + } + return nil +} + +func (m *CgroupStats) GetMemoryStats() *MemoryStats { + if m != nil { + return m.MemoryStats + } + return nil +} + +func (m *CgroupStats) GetPidsStats() *PidsStats { + if m != nil { + return m.PidsStats + } + return nil +} + +func (m *CgroupStats) GetBlkioStats() *BlkioStats { + if m != nil { + return m.BlkioStats + } + return nil +} + +func (m *CgroupStats) GetHugetlbStats() map[string]*HugetlbStats { + if m != nil { + return m.HugetlbStats + } + return nil +} + +type StatsContainerResponse struct { + CgroupStats *CgroupStats `protobuf:"bytes,1,opt,name=cgroup_stats,json=cgroupStats" json:"cgroup_stats,omitempty"` +} + +func (m *StatsContainerResponse) Reset() { *m = StatsContainerResponse{} } +func (m *StatsContainerResponse) String() string { return proto.CompactTextString(m) } +func (*StatsContainerResponse) ProtoMessage() {} +func (*StatsContainerResponse) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{21} } + +func (m *StatsContainerResponse) GetCgroupStats() *CgroupStats { + if m != nil { + return m.CgroupStats + } + return nil +} + type WriteStreamRequest struct { ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` ExecId string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` @@ -418,7 +870,7 @@ type WriteStreamRequest struct { func (m *WriteStreamRequest) Reset() { *m = WriteStreamRequest{} } func (m *WriteStreamRequest) String() string { return proto.CompactTextString(m) } func (*WriteStreamRequest) ProtoMessage() {} -func (*WriteStreamRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{10} } +func (*WriteStreamRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{22} } func (m *WriteStreamRequest) GetContainerId() string { if m != nil { @@ -448,7 +900,7 @@ type WriteStreamResponse struct { func (m *WriteStreamResponse) Reset() { *m = WriteStreamResponse{} } func (m *WriteStreamResponse) String() string { return proto.CompactTextString(m) } func (*WriteStreamResponse) ProtoMessage() {} -func (*WriteStreamResponse) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{11} } +func (*WriteStreamResponse) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{23} } func (m *WriteStreamResponse) GetLen() uint32 { if m != nil { @@ -466,7 +918,7 @@ type ReadStreamRequest struct { func (m *ReadStreamRequest) Reset() { *m = ReadStreamRequest{} } func (m *ReadStreamRequest) String() string { return proto.CompactTextString(m) } func (*ReadStreamRequest) ProtoMessage() {} -func (*ReadStreamRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{12} } +func (*ReadStreamRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{24} } func (m *ReadStreamRequest) GetContainerId() string { if m != nil { @@ -496,7 +948,7 @@ type ReadStreamResponse struct { func (m *ReadStreamResponse) Reset() { *m = ReadStreamResponse{} } func (m *ReadStreamResponse) String() string { return proto.CompactTextString(m) } func (*ReadStreamResponse) ProtoMessage() {} -func (*ReadStreamResponse) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{13} } +func (*ReadStreamResponse) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{25} } func (m *ReadStreamResponse) GetData() []byte { if m != nil { @@ -513,7 +965,7 @@ type CloseStdinRequest struct { func (m *CloseStdinRequest) Reset() { *m = CloseStdinRequest{} } func (m *CloseStdinRequest) String() string { return proto.CompactTextString(m) } func (*CloseStdinRequest) ProtoMessage() {} -func (*CloseStdinRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{14} } +func (*CloseStdinRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{26} } func (m *CloseStdinRequest) GetContainerId() string { if m != nil { @@ -539,7 +991,7 @@ type TtyWinResizeRequest struct { func (m *TtyWinResizeRequest) Reset() { *m = TtyWinResizeRequest{} } func (m *TtyWinResizeRequest) String() string { return proto.CompactTextString(m) } func (*TtyWinResizeRequest) ProtoMessage() {} -func (*TtyWinResizeRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{15} } +func (*TtyWinResizeRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{27} } func (m *TtyWinResizeRequest) GetContainerId() string { if m != nil { @@ -579,7 +1031,7 @@ type CreateSandboxRequest struct { func (m *CreateSandboxRequest) Reset() { *m = CreateSandboxRequest{} } func (m *CreateSandboxRequest) String() string { return proto.CompactTextString(m) } func (*CreateSandboxRequest) ProtoMessage() {} -func (*CreateSandboxRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{16} } +func (*CreateSandboxRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{28} } func (m *CreateSandboxRequest) GetHostname() string { if m != nil { @@ -615,7 +1067,7 @@ type DestroySandboxRequest struct { func (m *DestroySandboxRequest) Reset() { *m = DestroySandboxRequest{} } func (m *DestroySandboxRequest) String() string { return proto.CompactTextString(m) } func (*DestroySandboxRequest) ProtoMessage() {} -func (*DestroySandboxRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{17} } +func (*DestroySandboxRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{29} } type IPAddress struct { Family IPFamily `protobuf:"varint,1,opt,name=family,proto3,enum=grpc.IPFamily" json:"family,omitempty"` @@ -626,7 +1078,7 @@ type IPAddress struct { func (m *IPAddress) Reset() { *m = IPAddress{} } func (m *IPAddress) String() string { return proto.CompactTextString(m) } func (*IPAddress) ProtoMessage() {} -func (*IPAddress) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{18} } +func (*IPAddress) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{30} } func (m *IPAddress) GetFamily() IPFamily { if m != nil { @@ -660,7 +1112,7 @@ type Interface struct { func (m *Interface) Reset() { *m = Interface{} } func (m *Interface) String() string { return proto.CompactTextString(m) } func (*Interface) ProtoMessage() {} -func (*Interface) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{19} } +func (*Interface) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{31} } func (m *Interface) GetDevice() string { if m != nil { @@ -708,7 +1160,7 @@ type Route struct { func (m *Route) Reset() { *m = Route{} } func (m *Route) String() string { return proto.CompactTextString(m) } func (*Route) ProtoMessage() {} -func (*Route) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{20} } +func (*Route) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{32} } func (m *Route) GetDest() string { if m != nil { @@ -752,7 +1204,7 @@ type Routes struct { func (m *Routes) Reset() { *m = Routes{} } func (m *Routes) String() string { return proto.CompactTextString(m) } func (*Routes) ProtoMessage() {} -func (*Routes) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{21} } +func (*Routes) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{33} } func (m *Routes) GetRoutes() []*Route { if m != nil { @@ -768,7 +1220,7 @@ type UpdateInterfaceRequest struct { func (m *UpdateInterfaceRequest) Reset() { *m = UpdateInterfaceRequest{} } func (m *UpdateInterfaceRequest) String() string { return proto.CompactTextString(m) } func (*UpdateInterfaceRequest) ProtoMessage() {} -func (*UpdateInterfaceRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{22} } +func (*UpdateInterfaceRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{34} } func (m *UpdateInterfaceRequest) GetInterface() *Interface { if m != nil { @@ -784,7 +1236,7 @@ type AddInterfaceRequest struct { func (m *AddInterfaceRequest) Reset() { *m = AddInterfaceRequest{} } func (m *AddInterfaceRequest) String() string { return proto.CompactTextString(m) } func (*AddInterfaceRequest) ProtoMessage() {} -func (*AddInterfaceRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{23} } +func (*AddInterfaceRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{35} } func (m *AddInterfaceRequest) GetInterface() *Interface { if m != nil { @@ -800,7 +1252,7 @@ type RemoveInterfaceRequest struct { func (m *RemoveInterfaceRequest) Reset() { *m = RemoveInterfaceRequest{} } func (m *RemoveInterfaceRequest) String() string { return proto.CompactTextString(m) } func (*RemoveInterfaceRequest) ProtoMessage() {} -func (*RemoveInterfaceRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{24} } +func (*RemoveInterfaceRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{36} } func (m *RemoveInterfaceRequest) GetInterface() *Interface { if m != nil { @@ -816,7 +1268,7 @@ type UpdateRoutesRequest struct { func (m *UpdateRoutesRequest) Reset() { *m = UpdateRoutesRequest{} } func (m *UpdateRoutesRequest) String() string { return proto.CompactTextString(m) } func (*UpdateRoutesRequest) ProtoMessage() {} -func (*UpdateRoutesRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{25} } +func (*UpdateRoutesRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{37} } func (m *UpdateRoutesRequest) GetRoutes() *Routes { if m != nil { @@ -837,7 +1289,7 @@ type OnlineCPUMemRequest struct { func (m *OnlineCPUMemRequest) Reset() { *m = OnlineCPUMemRequest{} } func (m *OnlineCPUMemRequest) String() string { return proto.CompactTextString(m) } func (*OnlineCPUMemRequest) ProtoMessage() {} -func (*OnlineCPUMemRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{26} } +func (*OnlineCPUMemRequest) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{38} } func (m *OnlineCPUMemRequest) GetWait() bool { if m != nil { @@ -886,7 +1338,7 @@ type Storage struct { func (m *Storage) Reset() { *m = Storage{} } func (m *Storage) String() string { return proto.CompactTextString(m) } func (*Storage) ProtoMessage() {} -func (*Storage) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{27} } +func (*Storage) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{39} } func (m *Storage) GetDriver() string { if m != nil { @@ -969,7 +1421,7 @@ type Device struct { func (m *Device) Reset() { *m = Device{} } func (m *Device) String() string { return proto.CompactTextString(m) } func (*Device) ProtoMessage() {} -func (*Device) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{28} } +func (*Device) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{40} } func (m *Device) GetId() string { if m != nil { @@ -1015,7 +1467,7 @@ type StringUser struct { func (m *StringUser) Reset() { *m = StringUser{} } func (m *StringUser) String() string { return proto.CompactTextString(m) } func (*StringUser) ProtoMessage() {} -func (*StringUser) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{29} } +func (*StringUser) Descriptor() ([]byte, []int) { return fileDescriptorAgent, []int{41} } func (m *StringUser) GetUid() string { if m != nil { @@ -1049,6 +1501,18 @@ func init() { proto.RegisterType((*ListProcessesRequest)(nil), "grpc.ListProcessesRequest") proto.RegisterType((*ListProcessesResponse)(nil), "grpc.ListProcessesResponse") proto.RegisterType((*UpdateContainerRequest)(nil), "grpc.UpdateContainerRequest") + proto.RegisterType((*StatsContainerRequest)(nil), "grpc.StatsContainerRequest") + proto.RegisterType((*CpuUsage)(nil), "grpc.CpuUsage") + proto.RegisterType((*ThrottlingData)(nil), "grpc.ThrottlingData") + proto.RegisterType((*CpuStats)(nil), "grpc.CpuStats") + proto.RegisterType((*PidsStats)(nil), "grpc.PidsStats") + proto.RegisterType((*MemoryData)(nil), "grpc.MemoryData") + proto.RegisterType((*MemoryStats)(nil), "grpc.MemoryStats") + proto.RegisterType((*BlkioStatsEntry)(nil), "grpc.BlkioStatsEntry") + proto.RegisterType((*BlkioStats)(nil), "grpc.BlkioStats") + proto.RegisterType((*HugetlbStats)(nil), "grpc.HugetlbStats") + proto.RegisterType((*CgroupStats)(nil), "grpc.CgroupStats") + proto.RegisterType((*StatsContainerResponse)(nil), "grpc.StatsContainerResponse") proto.RegisterType((*WriteStreamRequest)(nil), "grpc.WriteStreamRequest") proto.RegisterType((*WriteStreamResponse)(nil), "grpc.WriteStreamResponse") proto.RegisterType((*ReadStreamRequest)(nil), "grpc.ReadStreamRequest") @@ -1098,6 +1562,7 @@ type AgentServiceClient interface { WaitProcess(ctx context.Context, in *WaitProcessRequest, opts ...grpc1.CallOption) (*WaitProcessResponse, error) ListProcesses(ctx context.Context, in *ListProcessesRequest, opts ...grpc1.CallOption) (*ListProcessesResponse, error) UpdateContainer(ctx context.Context, in *UpdateContainerRequest, opts ...grpc1.CallOption) (*google_protobuf2.Empty, error) + StatsContainer(ctx context.Context, in *StatsContainerRequest, opts ...grpc1.CallOption) (*StatsContainerResponse, error) // stdio WriteStdin(ctx context.Context, in *WriteStreamRequest, opts ...grpc1.CallOption) (*WriteStreamResponse, error) ReadStdout(ctx context.Context, in *ReadStreamRequest, opts ...grpc1.CallOption) (*ReadStreamResponse, error) @@ -1195,9 +1660,18 @@ func (c *agentServiceClient) UpdateContainer(ctx context.Context, in *UpdateCont return out, nil } -func (c *agentServiceClient) WriteStdin(ctx context.Context, in *WriteStreamRequest, opts ...grpc1.CallOption) (*WriteStreamResponse, error) { - out := new(WriteStreamResponse) - err := grpc1.Invoke(ctx, "/grpc.AgentService/WriteStdin", in, out, c.cc, opts...) +func (c *agentServiceClient) StatsContainer(ctx context.Context, in *StatsContainerRequest, opts ...grpc1.CallOption) (*StatsContainerResponse, error) { + out := new(StatsContainerResponse) + err := grpc1.Invoke(ctx, "/grpc.AgentService/StatsContainer", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *agentServiceClient) WriteStdin(ctx context.Context, in *WriteStreamRequest, opts ...grpc1.CallOption) (*WriteStreamResponse, error) { + out := new(WriteStreamResponse) + err := grpc1.Invoke(ctx, "/grpc.AgentService/WriteStdin", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1321,6 +1795,7 @@ type AgentServiceServer interface { WaitProcess(context.Context, *WaitProcessRequest) (*WaitProcessResponse, error) ListProcesses(context.Context, *ListProcessesRequest) (*ListProcessesResponse, error) UpdateContainer(context.Context, *UpdateContainerRequest) (*google_protobuf2.Empty, error) + StatsContainer(context.Context, *StatsContainerRequest) (*StatsContainerResponse, error) // stdio WriteStdin(context.Context, *WriteStreamRequest) (*WriteStreamResponse, error) ReadStdout(context.Context, *ReadStreamRequest) (*ReadStreamResponse, error) @@ -1486,6 +1961,24 @@ func _AgentService_UpdateContainer_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _AgentService_StatsContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc1.UnaryServerInterceptor) (interface{}, error) { + in := new(StatsContainerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentServiceServer).StatsContainer(ctx, in) + } + info := &grpc1.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.AgentService/StatsContainer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentServiceServer).StatsContainer(ctx, req.(*StatsContainerRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _AgentService_WriteStdin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc1.UnaryServerInterceptor) (interface{}, error) { in := new(WriteStreamRequest) if err := dec(in); err != nil { @@ -1738,6 +2231,10 @@ var _AgentService_serviceDesc = grpc1.ServiceDesc{ MethodName: "UpdateContainer", Handler: _AgentService_UpdateContainer_Handler, }, + { + MethodName: "StatsContainer", + Handler: _AgentService_StatsContainer_Handler, + }, { MethodName: "WriteStdin", Handler: _AgentService_WriteStdin_Handler, @@ -2159,7 +2656,7 @@ func (m *UpdateContainerRequest) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *WriteStreamRequest) Marshal() (dAtA []byte, err error) { +func (m *StatsContainerRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2169,7 +2666,7 @@ func (m *WriteStreamRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *WriteStreamRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *StatsContainerRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int @@ -2180,22 +2677,10 @@ func (m *WriteStreamRequest) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintAgent(dAtA, i, uint64(len(m.ContainerId))) i += copy(dAtA[i:], m.ContainerId) } - if len(m.ExecId) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.ExecId))) - i += copy(dAtA[i:], m.ExecId) - } - if len(m.Data) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) - } return i, nil } -func (m *WriteStreamResponse) Marshal() (dAtA []byte, err error) { +func (m *CpuUsage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2205,20 +2690,47 @@ func (m *WriteStreamResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *WriteStreamResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *CpuUsage) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.Len != 0 { + if m.TotalUsage != 0 { dAtA[i] = 0x8 i++ - i = encodeVarintAgent(dAtA, i, uint64(m.Len)) + i = encodeVarintAgent(dAtA, i, uint64(m.TotalUsage)) + } + if len(m.PercpuUsage) > 0 { + dAtA7 := make([]byte, len(m.PercpuUsage)*10) + var j6 int + for _, num := range m.PercpuUsage { + for num >= 1<<7 { + dAtA7[j6] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j6++ + } + dAtA7[j6] = uint8(num) + j6++ + } + dAtA[i] = 0x12 + i++ + i = encodeVarintAgent(dAtA, i, uint64(j6)) + i += copy(dAtA[i:], dAtA7[:j6]) + } + if m.UsageInKernelmode != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.UsageInKernelmode)) + } + if m.UsageInUsermode != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.UsageInUsermode)) } return i, nil } -func (m *ReadStreamRequest) Marshal() (dAtA []byte, err error) { +func (m *ThrottlingData) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2228,32 +2740,30 @@ func (m *ReadStreamRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ReadStreamRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *ThrottlingData) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if len(m.ContainerId) > 0 { - dAtA[i] = 0xa + if m.Periods != 0 { + dAtA[i] = 0x8 i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.ContainerId))) - i += copy(dAtA[i:], m.ContainerId) + i = encodeVarintAgent(dAtA, i, uint64(m.Periods)) } - if len(m.ExecId) > 0 { - dAtA[i] = 0x12 + if m.ThrottledPeriods != 0 { + dAtA[i] = 0x10 i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.ExecId))) - i += copy(dAtA[i:], m.ExecId) + i = encodeVarintAgent(dAtA, i, uint64(m.ThrottledPeriods)) } - if m.Len != 0 { + if m.ThrottledTime != 0 { dAtA[i] = 0x18 i++ - i = encodeVarintAgent(dAtA, i, uint64(m.Len)) + i = encodeVarintAgent(dAtA, i, uint64(m.ThrottledTime)) } return i, nil } -func (m *ReadStreamResponse) Marshal() (dAtA []byte, err error) { +func (m *CpuStats) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2263,21 +2773,35 @@ func (m *ReadStreamResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ReadStreamResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *CpuStats) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if len(m.Data) > 0 { + if m.CpuUsage != nil { dAtA[i] = 0xa i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) + i = encodeVarintAgent(dAtA, i, uint64(m.CpuUsage.Size())) + n8, err := m.CpuUsage.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n8 + } + if m.ThrottlingData != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.ThrottlingData.Size())) + n9, err := m.ThrottlingData.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n9 } return i, nil } -func (m *CloseStdinRequest) Marshal() (dAtA []byte, err error) { +func (m *PidsStats) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2287,27 +2811,25 @@ func (m *CloseStdinRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CloseStdinRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *PidsStats) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if len(m.ContainerId) > 0 { - dAtA[i] = 0xa + if m.Current != 0 { + dAtA[i] = 0x8 i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.ContainerId))) - i += copy(dAtA[i:], m.ContainerId) + i = encodeVarintAgent(dAtA, i, uint64(m.Current)) } - if len(m.ExecId) > 0 { - dAtA[i] = 0x12 + if m.Limit != 0 { + dAtA[i] = 0x10 i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.ExecId))) - i += copy(dAtA[i:], m.ExecId) + i = encodeVarintAgent(dAtA, i, uint64(m.Limit)) } return i, nil } -func (m *TtyWinResizeRequest) Marshal() (dAtA []byte, err error) { +func (m *MemoryData) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2317,37 +2839,35 @@ func (m *TtyWinResizeRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TtyWinResizeRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *MemoryData) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if len(m.ContainerId) > 0 { - dAtA[i] = 0xa + if m.Usage != 0 { + dAtA[i] = 0x8 i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.ContainerId))) - i += copy(dAtA[i:], m.ContainerId) + i = encodeVarintAgent(dAtA, i, uint64(m.Usage)) } - if len(m.ExecId) > 0 { - dAtA[i] = 0x12 + if m.MaxUsage != 0 { + dAtA[i] = 0x10 i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.ExecId))) - i += copy(dAtA[i:], m.ExecId) + i = encodeVarintAgent(dAtA, i, uint64(m.MaxUsage)) } - if m.Row != 0 { + if m.Failcnt != 0 { dAtA[i] = 0x18 i++ - i = encodeVarintAgent(dAtA, i, uint64(m.Row)) + i = encodeVarintAgent(dAtA, i, uint64(m.Failcnt)) } - if m.Column != 0 { + if m.Limit != 0 { dAtA[i] = 0x20 i++ - i = encodeVarintAgent(dAtA, i, uint64(m.Column)) + i = encodeVarintAgent(dAtA, i, uint64(m.Limit)) } return i, nil } -func (m *CreateSandboxRequest) Marshal() (dAtA []byte, err error) { +func (m *MemoryStats) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2357,76 +2877,76 @@ func (m *CreateSandboxRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CreateSandboxRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *MemoryStats) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if len(m.Hostname) > 0 { - dAtA[i] = 0xa + if m.Cache != 0 { + dAtA[i] = 0x8 i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.Hostname))) - i += copy(dAtA[i:], m.Hostname) + i = encodeVarintAgent(dAtA, i, uint64(m.Cache)) } - if len(m.Dns) > 0 { - for _, s := range m.Dns { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if m.Usage != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.Usage.Size())) + n10, err := m.Usage.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } + i += n10 } - if len(m.Storages) > 0 { - for _, msg := range m.Storages { - dAtA[i] = 0x1a - i++ - i = encodeVarintAgent(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n + if m.SwapUsage != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.SwapUsage.Size())) + n11, err := m.SwapUsage.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } + i += n11 } - if m.SandboxPidns { - dAtA[i] = 0x20 + if m.KernelUsage != nil { + dAtA[i] = 0x22 i++ - if m.SandboxPidns { + i = encodeVarintAgent(dAtA, i, uint64(m.KernelUsage.Size())) + n12, err := m.KernelUsage.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n12 + } + if m.UseHierarchy { + dAtA[i] = 0x28 + i++ + if m.UseHierarchy { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } - return i, nil -} - -func (m *DestroySandboxRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err + if len(m.Stats) > 0 { + for k, _ := range m.Stats { + dAtA[i] = 0x32 + i++ + v := m.Stats[k] + mapSize := 1 + len(k) + sovAgent(uint64(len(k))) + 1 + sovAgent(uint64(v)) + i = encodeVarintAgent(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + dAtA[i] = 0x10 + i++ + i = encodeVarintAgent(dAtA, i, uint64(v)) + } } - return dAtA[:n], nil -} - -func (m *DestroySandboxRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l return i, nil } -func (m *IPAddress) Marshal() (dAtA []byte, err error) { +func (m *BlkioStatsEntry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2436,32 +2956,36 @@ func (m *IPAddress) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *IPAddress) MarshalTo(dAtA []byte) (int, error) { +func (m *BlkioStatsEntry) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.Family != 0 { + if m.Major != 0 { dAtA[i] = 0x8 i++ - i = encodeVarintAgent(dAtA, i, uint64(m.Family)) + i = encodeVarintAgent(dAtA, i, uint64(m.Major)) } - if len(m.Address) > 0 { - dAtA[i] = 0x12 + if m.Minor != 0 { + dAtA[i] = 0x10 i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.Address))) - i += copy(dAtA[i:], m.Address) + i = encodeVarintAgent(dAtA, i, uint64(m.Minor)) } - if len(m.Mask) > 0 { + if len(m.Op) > 0 { dAtA[i] = 0x1a i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.Mask))) - i += copy(dAtA[i:], m.Mask) + i = encodeVarintAgent(dAtA, i, uint64(len(m.Op))) + i += copy(dAtA[i:], m.Op) + } + if m.Value != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.Value)) } return i, nil } -func (m *Interface) Marshal() (dAtA []byte, err error) { +func (m *BlkioStats) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2471,25 +2995,37 @@ func (m *Interface) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Interface) MarshalTo(dAtA []byte) (int, error) { +func (m *BlkioStats) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if len(m.Device) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.Device))) - i += copy(dAtA[i:], m.Device) + if len(m.IoServiceBytesRecursive) > 0 { + for _, msg := range m.IoServiceBytesRecursive { + dAtA[i] = 0xa + i++ + i = encodeVarintAgent(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } } - if len(m.Name) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if len(m.IoServicedRecursive) > 0 { + for _, msg := range m.IoServicedRecursive { + dAtA[i] = 0x12 + i++ + i = encodeVarintAgent(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } } - if len(m.IPAddresses) > 0 { - for _, msg := range m.IPAddresses { + if len(m.IoQueuedRecursive) > 0 { + for _, msg := range m.IoQueuedRecursive { dAtA[i] = 0x1a i++ i = encodeVarintAgent(dAtA, i, uint64(msg.Size())) @@ -2500,21 +3036,70 @@ func (m *Interface) MarshalTo(dAtA []byte) (int, error) { i += n } } - if m.Mtu != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintAgent(dAtA, i, uint64(m.Mtu)) + if len(m.IoServiceTimeRecursive) > 0 { + for _, msg := range m.IoServiceTimeRecursive { + dAtA[i] = 0x22 + i++ + i = encodeVarintAgent(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } } - if len(m.HwAddr) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.HwAddr))) - i += copy(dAtA[i:], m.HwAddr) + if len(m.IoWaitTimeRecursive) > 0 { + for _, msg := range m.IoWaitTimeRecursive { + dAtA[i] = 0x2a + i++ + i = encodeVarintAgent(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } } - return i, nil + if len(m.IoMergedRecursive) > 0 { + for _, msg := range m.IoMergedRecursive { + dAtA[i] = 0x32 + i++ + i = encodeVarintAgent(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if len(m.IoTimeRecursive) > 0 { + for _, msg := range m.IoTimeRecursive { + dAtA[i] = 0x3a + i++ + i = encodeVarintAgent(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if len(m.SectorsRecursive) > 0 { + for _, msg := range m.SectorsRecursive { + dAtA[i] = 0x42 + i++ + i = encodeVarintAgent(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil } -func (m *Route) Marshal() (dAtA []byte, err error) { +func (m *HugetlbStats) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2524,44 +3109,30 @@ func (m *Route) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Route) MarshalTo(dAtA []byte) (int, error) { +func (m *HugetlbStats) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if len(m.Dest) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.Dest))) - i += copy(dAtA[i:], m.Dest) - } - if len(m.Gateway) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.Gateway))) - i += copy(dAtA[i:], m.Gateway) - } - if len(m.Device) > 0 { - dAtA[i] = 0x1a + if m.Usage != 0 { + dAtA[i] = 0x8 i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.Device))) - i += copy(dAtA[i:], m.Device) + i = encodeVarintAgent(dAtA, i, uint64(m.Usage)) } - if len(m.Source) > 0 { - dAtA[i] = 0x22 + if m.MaxUsage != 0 { + dAtA[i] = 0x10 i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.Source))) - i += copy(dAtA[i:], m.Source) + i = encodeVarintAgent(dAtA, i, uint64(m.MaxUsage)) } - if m.Scope != 0 { - dAtA[i] = 0x28 + if m.Failcnt != 0 { + dAtA[i] = 0x18 i++ - i = encodeVarintAgent(dAtA, i, uint64(m.Scope)) + i = encodeVarintAgent(dAtA, i, uint64(m.Failcnt)) } return i, nil } -func (m *Routes) Marshal() (dAtA []byte, err error) { +func (m *CgroupStats) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2571,27 +3142,83 @@ func (m *Routes) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Routes) MarshalTo(dAtA []byte) (int, error) { +func (m *CgroupStats) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if len(m.Routes) > 0 { - for _, msg := range m.Routes { + if m.CpuStats != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.CpuStats.Size())) + n13, err := m.CpuStats.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n13 + } + if m.MemoryStats != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.MemoryStats.Size())) + n14, err := m.MemoryStats.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n14 + } + if m.PidsStats != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.PidsStats.Size())) + n15, err := m.PidsStats.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n15 + } + if m.BlkioStats != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.BlkioStats.Size())) + n16, err := m.BlkioStats.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n16 + } + if len(m.HugetlbStats) > 0 { + for k, _ := range m.HugetlbStats { + dAtA[i] = 0x2a + i++ + v := m.HugetlbStats[k] + msgSize := 0 + if v != nil { + msgSize = v.Size() + msgSize += 1 + sovAgent(uint64(msgSize)) + } + mapSize := 1 + len(k) + sovAgent(uint64(len(k))) + msgSize + i = encodeVarintAgent(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ - i = encodeVarintAgent(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + i = encodeVarintAgent(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + if v != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintAgent(dAtA, i, uint64(v.Size())) + n17, err := v.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n17 } - i += n } } return i, nil } -func (m *UpdateInterfaceRequest) Marshal() (dAtA []byte, err error) { +func (m *StatsContainerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2601,25 +3228,25 @@ func (m *UpdateInterfaceRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *UpdateInterfaceRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *StatsContainerResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.Interface != nil { + if m.CgroupStats != nil { dAtA[i] = 0xa i++ - i = encodeVarintAgent(dAtA, i, uint64(m.Interface.Size())) - n6, err := m.Interface.MarshalTo(dAtA[i:]) + i = encodeVarintAgent(dAtA, i, uint64(m.CgroupStats.Size())) + n18, err := m.CgroupStats.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n6 + i += n18 } return i, nil } -func (m *AddInterfaceRequest) Marshal() (dAtA []byte, err error) { +func (m *WriteStreamRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2629,25 +3256,33 @@ func (m *AddInterfaceRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AddInterfaceRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *WriteStreamRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.Interface != nil { + if len(m.ContainerId) > 0 { dAtA[i] = 0xa i++ - i = encodeVarintAgent(dAtA, i, uint64(m.Interface.Size())) - n7, err := m.Interface.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 + i = encodeVarintAgent(dAtA, i, uint64(len(m.ContainerId))) + i += copy(dAtA[i:], m.ContainerId) + } + if len(m.ExecId) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.ExecId))) + i += copy(dAtA[i:], m.ExecId) + } + if len(m.Data) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.Data))) + i += copy(dAtA[i:], m.Data) } return i, nil } -func (m *RemoveInterfaceRequest) Marshal() (dAtA []byte, err error) { +func (m *WriteStreamResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2657,25 +3292,20 @@ func (m *RemoveInterfaceRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RemoveInterfaceRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *WriteStreamResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.Interface != nil { - dAtA[i] = 0xa + if m.Len != 0 { + dAtA[i] = 0x8 i++ - i = encodeVarintAgent(dAtA, i, uint64(m.Interface.Size())) - n8, err := m.Interface.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n8 + i = encodeVarintAgent(dAtA, i, uint64(m.Len)) } return i, nil } -func (m *UpdateRoutesRequest) Marshal() (dAtA []byte, err error) { +func (m *ReadStreamRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2685,25 +3315,32 @@ func (m *UpdateRoutesRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *UpdateRoutesRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *ReadStreamRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.Routes != nil { + if len(m.ContainerId) > 0 { dAtA[i] = 0xa i++ - i = encodeVarintAgent(dAtA, i, uint64(m.Routes.Size())) - n9, err := m.Routes.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n9 + i = encodeVarintAgent(dAtA, i, uint64(len(m.ContainerId))) + i += copy(dAtA[i:], m.ContainerId) + } + if len(m.ExecId) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.ExecId))) + i += copy(dAtA[i:], m.ExecId) + } + if m.Len != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.Len)) } return i, nil } -func (m *OnlineCPUMemRequest) Marshal() (dAtA []byte, err error) { +func (m *ReadStreamResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2713,30 +3350,21 @@ func (m *OnlineCPUMemRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *OnlineCPUMemRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *ReadStreamResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.Wait { - dAtA[i] = 0x8 - i++ - if m.Wait { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.NbCpus != 0 { - dAtA[i] = 0x10 + if len(m.Data) > 0 { + dAtA[i] = 0xa i++ - i = encodeVarintAgent(dAtA, i, uint64(m.NbCpus)) + i = encodeVarintAgent(dAtA, i, uint64(len(m.Data))) + i += copy(dAtA[i:], m.Data) } return i, nil } -func (m *Storage) Marshal() (dAtA []byte, err error) { +func (m *CloseStdinRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2746,69 +3374,27 @@ func (m *Storage) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Storage) MarshalTo(dAtA []byte) (int, error) { +func (m *CloseStdinRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if len(m.Driver) > 0 { + if len(m.ContainerId) > 0 { dAtA[i] = 0xa i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.Driver))) - i += copy(dAtA[i:], m.Driver) - } - if len(m.DriverOptions) > 0 { - for _, s := range m.DriverOptions { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.Source) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.Source))) - i += copy(dAtA[i:], m.Source) - } - if len(m.Fstype) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.Fstype))) - i += copy(dAtA[i:], m.Fstype) - } - if len(m.Options) > 0 { - for _, s := range m.Options { - dAtA[i] = 0x2a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + i = encodeVarintAgent(dAtA, i, uint64(len(m.ContainerId))) + i += copy(dAtA[i:], m.ContainerId) } - if len(m.MountPoint) > 0 { - dAtA[i] = 0x32 + if len(m.ExecId) > 0 { + dAtA[i] = 0x12 i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.MountPoint))) - i += copy(dAtA[i:], m.MountPoint) + i = encodeVarintAgent(dAtA, i, uint64(len(m.ExecId))) + i += copy(dAtA[i:], m.ExecId) } return i, nil } -func (m *Device) Marshal() (dAtA []byte, err error) { +func (m *TtyWinResizeRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2818,54 +3404,37 @@ func (m *Device) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Device) MarshalTo(dAtA []byte) (int, error) { +func (m *TtyWinResizeRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if len(m.Id) > 0 { + if len(m.ContainerId) > 0 { dAtA[i] = 0xa i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.Id))) - i += copy(dAtA[i:], m.Id) + i = encodeVarintAgent(dAtA, i, uint64(len(m.ContainerId))) + i += copy(dAtA[i:], m.ContainerId) } - if len(m.Type) > 0 { + if len(m.ExecId) > 0 { dAtA[i] = 0x12 i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.Type))) - i += copy(dAtA[i:], m.Type) + i = encodeVarintAgent(dAtA, i, uint64(len(m.ExecId))) + i += copy(dAtA[i:], m.ExecId) } - if len(m.VmPath) > 0 { - dAtA[i] = 0x1a + if m.Row != 0 { + dAtA[i] = 0x18 i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.VmPath))) - i += copy(dAtA[i:], m.VmPath) + i = encodeVarintAgent(dAtA, i, uint64(m.Row)) } - if len(m.ContainerPath) > 0 { - dAtA[i] = 0x22 + if m.Column != 0 { + dAtA[i] = 0x20 i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.ContainerPath))) - i += copy(dAtA[i:], m.ContainerPath) - } - if len(m.Options) > 0 { - for _, s := range m.Options { - dAtA[i] = 0x2a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + i = encodeVarintAgent(dAtA, i, uint64(m.Column)) } return i, nil } -func (m *StringUser) Marshal() (dAtA []byte, err error) { +func (m *CreateSandboxRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2875,26 +3444,20 @@ func (m *StringUser) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *StringUser) MarshalTo(dAtA []byte) (int, error) { +func (m *CreateSandboxRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if len(m.Uid) > 0 { + if len(m.Hostname) > 0 { dAtA[i] = 0xa i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.Uid))) - i += copy(dAtA[i:], m.Uid) - } - if len(m.Gid) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintAgent(dAtA, i, uint64(len(m.Gid))) - i += copy(dAtA[i:], m.Gid) + i = encodeVarintAgent(dAtA, i, uint64(len(m.Hostname))) + i += copy(dAtA[i:], m.Hostname) } - if len(m.AdditionalGids) > 0 { - for _, s := range m.AdditionalGids { - dAtA[i] = 0x1a + if len(m.Dns) > 0 { + for _, s := range m.Dns { + dAtA[i] = 0x12 i++ l = len(s) for l >= 1<<7 { @@ -2907,529 +3470,3089 @@ func (m *StringUser) MarshalTo(dAtA []byte) (int, error) { i += copy(dAtA[i:], s) } } - return i, nil -} - -func encodeVarintAgent(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *CreateContainerRequest) Size() (n int) { - var l int - _ = l - l = len(m.ContainerId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) - } - l = len(m.ExecId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) - } - if m.StringUser != nil { - l = m.StringUser.Size() - n += 1 + l + sovAgent(uint64(l)) - } - if len(m.Devices) > 0 { - for _, e := range m.Devices { - l = e.Size() - n += 1 + l + sovAgent(uint64(l)) - } - } if len(m.Storages) > 0 { - for _, e := range m.Storages { - l = e.Size() - n += 1 + l + sovAgent(uint64(l)) + for _, msg := range m.Storages { + dAtA[i] = 0x1a + i++ + i = encodeVarintAgent(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n } } - if m.OCI != nil { - l = m.OCI.Size() - n += 1 + l + sovAgent(uint64(l)) + if m.SandboxPidns { + dAtA[i] = 0x20 + i++ + if m.SandboxPidns { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ } - return n + return i, nil } -func (m *StartContainerRequest) Size() (n int) { - var l int - _ = l - l = len(m.ContainerId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) +func (m *DestroySandboxRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *RemoveContainerRequest) Size() (n int) { +func (m *DestroySandboxRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - l = len(m.ContainerId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) - } - if m.Timeout != 0 { - n += 1 + sovAgent(uint64(m.Timeout)) + return i, nil +} + +func (m *IPAddress) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *ExecProcessRequest) Size() (n int) { +func (m *IPAddress) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - l = len(m.ContainerId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) + if m.Family != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.Family)) } - l = len(m.ExecId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) + if len(m.Address) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.Address))) + i += copy(dAtA[i:], m.Address) } - if m.StringUser != nil { - l = m.StringUser.Size() - n += 1 + l + sovAgent(uint64(l)) + if len(m.Mask) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.Mask))) + i += copy(dAtA[i:], m.Mask) } - if m.Process != nil { - l = m.Process.Size() - n += 1 + l + sovAgent(uint64(l)) + return i, nil +} + +func (m *Interface) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *SignalProcessRequest) Size() (n int) { +func (m *Interface) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - l = len(m.ContainerId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) + if len(m.Device) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.Device))) + i += copy(dAtA[i:], m.Device) } - l = len(m.ExecId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) + if len(m.Name) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) } - if m.Signal != 0 { - n += 1 + sovAgent(uint64(m.Signal)) + if len(m.IPAddresses) > 0 { + for _, msg := range m.IPAddresses { + dAtA[i] = 0x1a + i++ + i = encodeVarintAgent(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } } - return n + if m.Mtu != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.Mtu)) + } + if len(m.HwAddr) > 0 { + dAtA[i] = 0x2a + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.HwAddr))) + i += copy(dAtA[i:], m.HwAddr) + } + return i, nil } -func (m *WaitProcessRequest) Size() (n int) { - var l int - _ = l - l = len(m.ContainerId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) - } - l = len(m.ExecId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) +func (m *Route) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *WaitProcessResponse) Size() (n int) { +func (m *Route) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Status != 0 { - n += 1 + sovAgent(uint64(m.Status)) + if len(m.Dest) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.Dest))) + i += copy(dAtA[i:], m.Dest) } - return n -} - -func (m *ListProcessesRequest) Size() (n int) { - var l int - _ = l - l = len(m.ContainerId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) + if len(m.Gateway) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.Gateway))) + i += copy(dAtA[i:], m.Gateway) } - l = len(m.Format) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) + if len(m.Device) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.Device))) + i += copy(dAtA[i:], m.Device) } - if len(m.Args) > 0 { - for _, s := range m.Args { - l = len(s) - n += 1 + l + sovAgent(uint64(l)) - } + if len(m.Source) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.Source))) + i += copy(dAtA[i:], m.Source) } - return n + if m.Scope != 0 { + dAtA[i] = 0x28 + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.Scope)) + } + return i, nil } -func (m *ListProcessesResponse) Size() (n int) { - var l int - _ = l - l = len(m.ProcessList) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) +func (m *Routes) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *UpdateContainerRequest) Size() (n int) { +func (m *Routes) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - l = len(m.ContainerId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) - } - if m.Resources != nil { - l = m.Resources.Size() - n += 1 + l + sovAgent(uint64(l)) + if len(m.Routes) > 0 { + for _, msg := range m.Routes { + dAtA[i] = 0xa + i++ + i = encodeVarintAgent(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } } - return n + return i, nil } -func (m *WriteStreamRequest) Size() (n int) { - var l int - _ = l - l = len(m.ContainerId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) - } - l = len(m.ExecId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) +func (m *UpdateInterfaceRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *WriteStreamResponse) Size() (n int) { +func (m *UpdateInterfaceRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Len != 0 { - n += 1 + sovAgent(uint64(m.Len)) + if m.Interface != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.Interface.Size())) + n19, err := m.Interface.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n19 } - return n + return i, nil } -func (m *ReadStreamRequest) Size() (n int) { - var l int - _ = l - l = len(m.ContainerId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) - } - l = len(m.ExecId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) - } - if m.Len != 0 { - n += 1 + sovAgent(uint64(m.Len)) +func (m *AddInterfaceRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *ReadStreamResponse) Size() (n int) { +func (m *AddInterfaceRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - l = len(m.Data) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) + if m.Interface != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.Interface.Size())) + n20, err := m.Interface.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n20 } - return n + return i, nil } -func (m *CloseStdinRequest) Size() (n int) { - var l int - _ = l - l = len(m.ContainerId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) - } - l = len(m.ExecId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) +func (m *RemoveInterfaceRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *TtyWinResizeRequest) Size() (n int) { +func (m *RemoveInterfaceRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - l = len(m.ContainerId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) - } - l = len(m.ExecId) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) - } - if m.Row != 0 { - n += 1 + sovAgent(uint64(m.Row)) + if m.Interface != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.Interface.Size())) + n21, err := m.Interface.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n21 } - if m.Column != 0 { - n += 1 + sovAgent(uint64(m.Column)) + return i, nil +} + +func (m *UpdateRoutesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *CreateSandboxRequest) Size() (n int) { +func (m *UpdateRoutesRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - l = len(m.Hostname) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) - } - if len(m.Dns) > 0 { - for _, s := range m.Dns { - l = len(s) - n += 1 + l + sovAgent(uint64(l)) - } - } - if len(m.Storages) > 0 { - for _, e := range m.Storages { - l = e.Size() - n += 1 + l + sovAgent(uint64(l)) + if m.Routes != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.Routes.Size())) + n22, err := m.Routes.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } + i += n22 } - if m.SandboxPidns { - n += 2 - } - return n + return i, nil } -func (m *DestroySandboxRequest) Size() (n int) { - var l int - _ = l - return n +func (m *OnlineCPUMemRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil } -func (m *IPAddress) Size() (n int) { +func (m *OnlineCPUMemRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Family != 0 { - n += 1 + sovAgent(uint64(m.Family)) + if m.Wait { + dAtA[i] = 0x8 + i++ + if m.Wait { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ } - l = len(m.Address) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) + if m.NbCpus != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintAgent(dAtA, i, uint64(m.NbCpus)) } - l = len(m.Mask) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) + return i, nil +} + +func (m *Storage) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *Interface) Size() (n int) { +func (m *Storage) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - l = len(m.Device) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) + if len(m.Driver) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.Driver))) + i += copy(dAtA[i:], m.Driver) } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) + if len(m.DriverOptions) > 0 { + for _, s := range m.DriverOptions { + dAtA[i] = 0x12 + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } } - if len(m.IPAddresses) > 0 { - for _, e := range m.IPAddresses { - l = e.Size() - n += 1 + l + sovAgent(uint64(l)) + if len(m.Source) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.Source))) + i += copy(dAtA[i:], m.Source) + } + if len(m.Fstype) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.Fstype))) + i += copy(dAtA[i:], m.Fstype) + } + if len(m.Options) > 0 { + for _, s := range m.Options { + dAtA[i] = 0x2a + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) } } - if m.Mtu != 0 { - n += 1 + sovAgent(uint64(m.Mtu)) + if len(m.MountPoint) > 0 { + dAtA[i] = 0x32 + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.MountPoint))) + i += copy(dAtA[i:], m.MountPoint) } - l = len(m.HwAddr) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) + return i, nil +} + +func (m *Device) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *Route) Size() (n int) { +func (m *Device) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - l = len(m.Dest) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) + if len(m.Id) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.Id))) + i += copy(dAtA[i:], m.Id) } - l = len(m.Gateway) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) + if len(m.Type) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.Type))) + i += copy(dAtA[i:], m.Type) } - l = len(m.Device) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) + if len(m.VmPath) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.VmPath))) + i += copy(dAtA[i:], m.VmPath) } - l = len(m.Source) - if l > 0 { - n += 1 + l + sovAgent(uint64(l)) + if len(m.ContainerPath) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.ContainerPath))) + i += copy(dAtA[i:], m.ContainerPath) } - if m.Scope != 0 { - n += 1 + sovAgent(uint64(m.Scope)) + if len(m.Options) > 0 { + for _, s := range m.Options { + dAtA[i] = 0x2a + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } } - return n + return i, nil } -func (m *Routes) Size() (n int) { +func (m *StringUser) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StringUser) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if len(m.Routes) > 0 { - for _, e := range m.Routes { - l = e.Size() - n += 1 + l + sovAgent(uint64(l)) + if len(m.Uid) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.Uid))) + i += copy(dAtA[i:], m.Uid) + } + if len(m.Gid) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintAgent(dAtA, i, uint64(len(m.Gid))) + i += copy(dAtA[i:], m.Gid) + } + if len(m.AdditionalGids) > 0 { + for _, s := range m.AdditionalGids { + dAtA[i] = 0x1a + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) } } - return n + return i, nil } -func (m *UpdateInterfaceRequest) Size() (n int) { +func encodeVarintAgent(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *CreateContainerRequest) Size() (n int) { var l int _ = l - if m.Interface != nil { - l = m.Interface.Size() + l = len(m.ContainerId) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + l = len(m.ExecId) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + if m.StringUser != nil { + l = m.StringUser.Size() + n += 1 + l + sovAgent(uint64(l)) + } + if len(m.Devices) > 0 { + for _, e := range m.Devices { + l = e.Size() + n += 1 + l + sovAgent(uint64(l)) + } + } + if len(m.Storages) > 0 { + for _, e := range m.Storages { + l = e.Size() + n += 1 + l + sovAgent(uint64(l)) + } + } + if m.OCI != nil { + l = m.OCI.Size() n += 1 + l + sovAgent(uint64(l)) } return n } -func (m *AddInterfaceRequest) Size() (n int) { +func (m *StartContainerRequest) Size() (n int) { var l int _ = l - if m.Interface != nil { - l = m.Interface.Size() + l = len(m.ContainerId) + if l > 0 { n += 1 + l + sovAgent(uint64(l)) } return n } -func (m *RemoveInterfaceRequest) Size() (n int) { +func (m *RemoveContainerRequest) Size() (n int) { var l int _ = l - if m.Interface != nil { - l = m.Interface.Size() + l = len(m.ContainerId) + if l > 0 { n += 1 + l + sovAgent(uint64(l)) } + if m.Timeout != 0 { + n += 1 + sovAgent(uint64(m.Timeout)) + } return n } -func (m *UpdateRoutesRequest) Size() (n int) { +func (m *ExecProcessRequest) Size() (n int) { var l int _ = l - if m.Routes != nil { - l = m.Routes.Size() + l = len(m.ContainerId) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + l = len(m.ExecId) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + if m.StringUser != nil { + l = m.StringUser.Size() + n += 1 + l + sovAgent(uint64(l)) + } + if m.Process != nil { + l = m.Process.Size() n += 1 + l + sovAgent(uint64(l)) } return n } -func (m *OnlineCPUMemRequest) Size() (n int) { +func (m *SignalProcessRequest) Size() (n int) { var l int _ = l - if m.Wait { - n += 2 + l = len(m.ContainerId) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) } - if m.NbCpus != 0 { - n += 1 + sovAgent(uint64(m.NbCpus)) + l = len(m.ExecId) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + if m.Signal != 0 { + n += 1 + sovAgent(uint64(m.Signal)) } return n } -func (m *Storage) Size() (n int) { +func (m *WaitProcessRequest) Size() (n int) { var l int _ = l - l = len(m.Driver) + l = len(m.ContainerId) if l > 0 { n += 1 + l + sovAgent(uint64(l)) } - if len(m.DriverOptions) > 0 { - for _, s := range m.DriverOptions { - l = len(s) - n += 1 + l + sovAgent(uint64(l)) - } + l = len(m.ExecId) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) } - l = len(m.Source) + return n +} + +func (m *WaitProcessResponse) Size() (n int) { + var l int + _ = l + if m.Status != 0 { + n += 1 + sovAgent(uint64(m.Status)) + } + return n +} + +func (m *ListProcessesRequest) Size() (n int) { + var l int + _ = l + l = len(m.ContainerId) if l > 0 { n += 1 + l + sovAgent(uint64(l)) } - l = len(m.Fstype) + l = len(m.Format) if l > 0 { n += 1 + l + sovAgent(uint64(l)) } - if len(m.Options) > 0 { - for _, s := range m.Options { + if len(m.Args) > 0 { + for _, s := range m.Args { l = len(s) n += 1 + l + sovAgent(uint64(l)) } } - l = len(m.MountPoint) + return n +} + +func (m *ListProcessesResponse) Size() (n int) { + var l int + _ = l + l = len(m.ProcessList) if l > 0 { n += 1 + l + sovAgent(uint64(l)) } return n } -func (m *Device) Size() (n int) { +func (m *UpdateContainerRequest) Size() (n int) { var l int _ = l - l = len(m.Id) + l = len(m.ContainerId) if l > 0 { n += 1 + l + sovAgent(uint64(l)) } - l = len(m.Type) - if l > 0 { + if m.Resources != nil { + l = m.Resources.Size() n += 1 + l + sovAgent(uint64(l)) } - l = len(m.VmPath) + return n +} + +func (m *StatsContainerRequest) Size() (n int) { + var l int + _ = l + l = len(m.ContainerId) if l > 0 { n += 1 + l + sovAgent(uint64(l)) } - l = len(m.ContainerPath) + return n +} + +func (m *CpuUsage) Size() (n int) { + var l int + _ = l + if m.TotalUsage != 0 { + n += 1 + sovAgent(uint64(m.TotalUsage)) + } + if len(m.PercpuUsage) > 0 { + l = 0 + for _, e := range m.PercpuUsage { + l += sovAgent(uint64(e)) + } + n += 1 + sovAgent(uint64(l)) + l + } + if m.UsageInKernelmode != 0 { + n += 1 + sovAgent(uint64(m.UsageInKernelmode)) + } + if m.UsageInUsermode != 0 { + n += 1 + sovAgent(uint64(m.UsageInUsermode)) + } + return n +} + +func (m *ThrottlingData) Size() (n int) { + var l int + _ = l + if m.Periods != 0 { + n += 1 + sovAgent(uint64(m.Periods)) + } + if m.ThrottledPeriods != 0 { + n += 1 + sovAgent(uint64(m.ThrottledPeriods)) + } + if m.ThrottledTime != 0 { + n += 1 + sovAgent(uint64(m.ThrottledTime)) + } + return n +} + +func (m *CpuStats) Size() (n int) { + var l int + _ = l + if m.CpuUsage != nil { + l = m.CpuUsage.Size() + n += 1 + l + sovAgent(uint64(l)) + } + if m.ThrottlingData != nil { + l = m.ThrottlingData.Size() + n += 1 + l + sovAgent(uint64(l)) + } + return n +} + +func (m *PidsStats) Size() (n int) { + var l int + _ = l + if m.Current != 0 { + n += 1 + sovAgent(uint64(m.Current)) + } + if m.Limit != 0 { + n += 1 + sovAgent(uint64(m.Limit)) + } + return n +} + +func (m *MemoryData) Size() (n int) { + var l int + _ = l + if m.Usage != 0 { + n += 1 + sovAgent(uint64(m.Usage)) + } + if m.MaxUsage != 0 { + n += 1 + sovAgent(uint64(m.MaxUsage)) + } + if m.Failcnt != 0 { + n += 1 + sovAgent(uint64(m.Failcnt)) + } + if m.Limit != 0 { + n += 1 + sovAgent(uint64(m.Limit)) + } + return n +} + +func (m *MemoryStats) Size() (n int) { + var l int + _ = l + if m.Cache != 0 { + n += 1 + sovAgent(uint64(m.Cache)) + } + if m.Usage != nil { + l = m.Usage.Size() + n += 1 + l + sovAgent(uint64(l)) + } + if m.SwapUsage != nil { + l = m.SwapUsage.Size() + n += 1 + l + sovAgent(uint64(l)) + } + if m.KernelUsage != nil { + l = m.KernelUsage.Size() + n += 1 + l + sovAgent(uint64(l)) + } + if m.UseHierarchy { + n += 2 + } + if len(m.Stats) > 0 { + for k, v := range m.Stats { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovAgent(uint64(len(k))) + 1 + sovAgent(uint64(v)) + n += mapEntrySize + 1 + sovAgent(uint64(mapEntrySize)) + } + } + return n +} + +func (m *BlkioStatsEntry) Size() (n int) { + var l int + _ = l + if m.Major != 0 { + n += 1 + sovAgent(uint64(m.Major)) + } + if m.Minor != 0 { + n += 1 + sovAgent(uint64(m.Minor)) + } + l = len(m.Op) if l > 0 { n += 1 + l + sovAgent(uint64(l)) } - if len(m.Options) > 0 { - for _, s := range m.Options { - l = len(s) + if m.Value != 0 { + n += 1 + sovAgent(uint64(m.Value)) + } + return n +} + +func (m *BlkioStats) Size() (n int) { + var l int + _ = l + if len(m.IoServiceBytesRecursive) > 0 { + for _, e := range m.IoServiceBytesRecursive { + l = e.Size() + n += 1 + l + sovAgent(uint64(l)) + } + } + if len(m.IoServicedRecursive) > 0 { + for _, e := range m.IoServicedRecursive { + l = e.Size() + n += 1 + l + sovAgent(uint64(l)) + } + } + if len(m.IoQueuedRecursive) > 0 { + for _, e := range m.IoQueuedRecursive { + l = e.Size() + n += 1 + l + sovAgent(uint64(l)) + } + } + if len(m.IoServiceTimeRecursive) > 0 { + for _, e := range m.IoServiceTimeRecursive { + l = e.Size() + n += 1 + l + sovAgent(uint64(l)) + } + } + if len(m.IoWaitTimeRecursive) > 0 { + for _, e := range m.IoWaitTimeRecursive { + l = e.Size() + n += 1 + l + sovAgent(uint64(l)) + } + } + if len(m.IoMergedRecursive) > 0 { + for _, e := range m.IoMergedRecursive { + l = e.Size() + n += 1 + l + sovAgent(uint64(l)) + } + } + if len(m.IoTimeRecursive) > 0 { + for _, e := range m.IoTimeRecursive { + l = e.Size() + n += 1 + l + sovAgent(uint64(l)) + } + } + if len(m.SectorsRecursive) > 0 { + for _, e := range m.SectorsRecursive { + l = e.Size() n += 1 + l + sovAgent(uint64(l)) } } return n } -func (m *StringUser) Size() (n int) { +func (m *HugetlbStats) Size() (n int) { var l int _ = l - l = len(m.Uid) + if m.Usage != 0 { + n += 1 + sovAgent(uint64(m.Usage)) + } + if m.MaxUsage != 0 { + n += 1 + sovAgent(uint64(m.MaxUsage)) + } + if m.Failcnt != 0 { + n += 1 + sovAgent(uint64(m.Failcnt)) + } + return n +} + +func (m *CgroupStats) Size() (n int) { + var l int + _ = l + if m.CpuStats != nil { + l = m.CpuStats.Size() + n += 1 + l + sovAgent(uint64(l)) + } + if m.MemoryStats != nil { + l = m.MemoryStats.Size() + n += 1 + l + sovAgent(uint64(l)) + } + if m.PidsStats != nil { + l = m.PidsStats.Size() + n += 1 + l + sovAgent(uint64(l)) + } + if m.BlkioStats != nil { + l = m.BlkioStats.Size() + n += 1 + l + sovAgent(uint64(l)) + } + if len(m.HugetlbStats) > 0 { + for k, v := range m.HugetlbStats { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovAgent(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovAgent(uint64(len(k))) + l + n += mapEntrySize + 1 + sovAgent(uint64(mapEntrySize)) + } + } + return n +} + +func (m *StatsContainerResponse) Size() (n int) { + var l int + _ = l + if m.CgroupStats != nil { + l = m.CgroupStats.Size() + n += 1 + l + sovAgent(uint64(l)) + } + return n +} + +func (m *WriteStreamRequest) Size() (n int) { + var l int + _ = l + l = len(m.ContainerId) if l > 0 { n += 1 + l + sovAgent(uint64(l)) } - l = len(m.Gid) + l = len(m.ExecId) if l > 0 { n += 1 + l + sovAgent(uint64(l)) } - if len(m.AdditionalGids) > 0 { - for _, s := range m.AdditionalGids { - l = len(s) - n += 1 + l + sovAgent(uint64(l)) + l = len(m.Data) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + return n +} + +func (m *WriteStreamResponse) Size() (n int) { + var l int + _ = l + if m.Len != 0 { + n += 1 + sovAgent(uint64(m.Len)) + } + return n +} + +func (m *ReadStreamRequest) Size() (n int) { + var l int + _ = l + l = len(m.ContainerId) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + l = len(m.ExecId) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + if m.Len != 0 { + n += 1 + sovAgent(uint64(m.Len)) + } + return n +} + +func (m *ReadStreamResponse) Size() (n int) { + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + return n +} + +func (m *CloseStdinRequest) Size() (n int) { + var l int + _ = l + l = len(m.ContainerId) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + l = len(m.ExecId) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + return n +} + +func (m *TtyWinResizeRequest) Size() (n int) { + var l int + _ = l + l = len(m.ContainerId) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + l = len(m.ExecId) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + if m.Row != 0 { + n += 1 + sovAgent(uint64(m.Row)) + } + if m.Column != 0 { + n += 1 + sovAgent(uint64(m.Column)) + } + return n +} + +func (m *CreateSandboxRequest) Size() (n int) { + var l int + _ = l + l = len(m.Hostname) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + if len(m.Dns) > 0 { + for _, s := range m.Dns { + l = len(s) + n += 1 + l + sovAgent(uint64(l)) + } + } + if len(m.Storages) > 0 { + for _, e := range m.Storages { + l = e.Size() + n += 1 + l + sovAgent(uint64(l)) + } + } + if m.SandboxPidns { + n += 2 + } + return n +} + +func (m *DestroySandboxRequest) Size() (n int) { + var l int + _ = l + return n +} + +func (m *IPAddress) Size() (n int) { + var l int + _ = l + if m.Family != 0 { + n += 1 + sovAgent(uint64(m.Family)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + l = len(m.Mask) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + return n +} + +func (m *Interface) Size() (n int) { + var l int + _ = l + l = len(m.Device) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + if len(m.IPAddresses) > 0 { + for _, e := range m.IPAddresses { + l = e.Size() + n += 1 + l + sovAgent(uint64(l)) + } + } + if m.Mtu != 0 { + n += 1 + sovAgent(uint64(m.Mtu)) + } + l = len(m.HwAddr) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + return n +} + +func (m *Route) Size() (n int) { + var l int + _ = l + l = len(m.Dest) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + l = len(m.Gateway) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + l = len(m.Device) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + l = len(m.Source) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + if m.Scope != 0 { + n += 1 + sovAgent(uint64(m.Scope)) + } + return n +} + +func (m *Routes) Size() (n int) { + var l int + _ = l + if len(m.Routes) > 0 { + for _, e := range m.Routes { + l = e.Size() + n += 1 + l + sovAgent(uint64(l)) + } + } + return n +} + +func (m *UpdateInterfaceRequest) Size() (n int) { + var l int + _ = l + if m.Interface != nil { + l = m.Interface.Size() + n += 1 + l + sovAgent(uint64(l)) + } + return n +} + +func (m *AddInterfaceRequest) Size() (n int) { + var l int + _ = l + if m.Interface != nil { + l = m.Interface.Size() + n += 1 + l + sovAgent(uint64(l)) + } + return n +} + +func (m *RemoveInterfaceRequest) Size() (n int) { + var l int + _ = l + if m.Interface != nil { + l = m.Interface.Size() + n += 1 + l + sovAgent(uint64(l)) + } + return n +} + +func (m *UpdateRoutesRequest) Size() (n int) { + var l int + _ = l + if m.Routes != nil { + l = m.Routes.Size() + n += 1 + l + sovAgent(uint64(l)) + } + return n +} + +func (m *OnlineCPUMemRequest) Size() (n int) { + var l int + _ = l + if m.Wait { + n += 2 + } + if m.NbCpus != 0 { + n += 1 + sovAgent(uint64(m.NbCpus)) + } + return n +} + +func (m *Storage) Size() (n int) { + var l int + _ = l + l = len(m.Driver) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + if len(m.DriverOptions) > 0 { + for _, s := range m.DriverOptions { + l = len(s) + n += 1 + l + sovAgent(uint64(l)) + } + } + l = len(m.Source) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + l = len(m.Fstype) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + if len(m.Options) > 0 { + for _, s := range m.Options { + l = len(s) + n += 1 + l + sovAgent(uint64(l)) + } + } + l = len(m.MountPoint) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + return n +} + +func (m *Device) Size() (n int) { + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + l = len(m.Type) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + l = len(m.VmPath) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + l = len(m.ContainerPath) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + if len(m.Options) > 0 { + for _, s := range m.Options { + l = len(s) + n += 1 + l + sovAgent(uint64(l)) + } + } + return n +} + +func (m *StringUser) Size() (n int) { + var l int + _ = l + l = len(m.Uid) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + l = len(m.Gid) + if l > 0 { + n += 1 + l + sovAgent(uint64(l)) + } + if len(m.AdditionalGids) > 0 { + for _, s := range m.AdditionalGids { + l = len(s) + n += 1 + l + sovAgent(uint64(l)) + } + } + return n +} + +func sovAgent(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozAgent(x uint64) (n int) { + return sovAgent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *CreateContainerRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateContainerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StringUser", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.StringUser == nil { + m.StringUser = &StringUser{} + } + if err := m.StringUser.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Devices = append(m.Devices, &Device{}) + if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Storages", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Storages = append(m.Storages, &Storage{}) + if err := m.Storages[len(m.Storages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OCI", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.OCI == nil { + m.OCI = &Spec{} + } + if err := m.OCI.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAgent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthAgent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StartContainerRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StartContainerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StartContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAgent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthAgent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RemoveContainerRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RemoveContainerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RemoveContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) + } + m.Timeout = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timeout |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAgent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthAgent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExecProcessRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExecProcessRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StringUser", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.StringUser == nil { + m.StringUser = &StringUser{} + } + if err := m.StringUser.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Process", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Process == nil { + m.Process = &Process{} + } + if err := m.Process.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAgent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthAgent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SignalProcessRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SignalProcessRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SignalProcessRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Signal", wireType) + } + m.Signal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Signal |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAgent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthAgent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WaitProcessRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WaitProcessRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WaitProcessRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAgent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthAgent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WaitProcessResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WaitProcessResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WaitProcessResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= (int32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAgent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthAgent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListProcessesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ListProcessesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListProcessesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Format = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Args = append(m.Args, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAgent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthAgent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListProcessesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ListProcessesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListProcessesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProcessList", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProcessList = append(m.ProcessList[:0], dAtA[iNdEx:postIndex]...) + if m.ProcessList == nil { + m.ProcessList = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAgent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthAgent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdateContainerRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdateContainerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Resources == nil { + m.Resources = &LinuxResources{} + } + if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAgent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthAgent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatsContainerRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StatsContainerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatsContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAgent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthAgent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CpuUsage) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CpuUsage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CpuUsage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalUsage", wireType) + } + m.TotalUsage = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalUsage |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.PercpuUsage = append(m.PercpuUsage, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + packedLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.PercpuUsage = append(m.PercpuUsage, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field PercpuUsage", wireType) + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UsageInKernelmode", wireType) + } + m.UsageInKernelmode = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UsageInKernelmode |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UsageInUsermode", wireType) + } + m.UsageInUsermode = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UsageInUsermode |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAgent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthAgent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ThrottlingData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ThrottlingData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ThrottlingData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Periods", wireType) + } + m.Periods = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Periods |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ThrottledPeriods", wireType) + } + m.ThrottledPeriods = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ThrottledPeriods |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ThrottledTime", wireType) + } + m.ThrottledTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ThrottledTime |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAgent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthAgent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CpuStats) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CpuStats: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CpuStats: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CpuUsage", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CpuUsage == nil { + m.CpuUsage = &CpuUsage{} + } + if err := m.CpuUsage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ThrottlingData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ThrottlingData == nil { + m.ThrottlingData = &ThrottlingData{} + } + if err := m.ThrottlingData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAgent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthAgent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PidsStats) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PidsStats: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PidsStats: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Current", wireType) + } + m.Current = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Current |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAgent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthAgent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy } } - return n -} -func sovAgent(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } + if iNdEx > l { + return io.ErrUnexpectedEOF } - return n -} -func sozAgent(x uint64) (n int) { - return sovAgent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + return nil } -func (m *CreateContainerRequest) Unmarshal(dAtA []byte) error { +func (m *MemoryData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3452,17 +6575,17 @@ func (m *CreateContainerRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CreateContainerRequest: wiretype end group for non-group") + return fmt.Errorf("proto: MemoryData: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CreateContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MemoryData: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Usage", wireType) } - var stringLen uint64 + m.Usage = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAgent @@ -3472,26 +6595,16 @@ func (m *CreateContainerRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + m.Usage |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAgent - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContainerId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecId", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxUsage", wireType) } - var stringLen uint64 + m.MaxUsage = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAgent @@ -3501,26 +6614,35 @@ func (m *CreateContainerRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + m.MaxUsage |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAgent + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Failcnt", wireType) } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF + m.Failcnt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Failcnt |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - m.ExecId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StringUser", wireType) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) } - var msglen int + m.Limit = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAgent @@ -3530,28 +6652,83 @@ func (m *CreateContainerRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + m.Limit |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + default: + iNdEx = preIndex + skippy, err := skipAgent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { return ErrInvalidLengthAgent } - postIndex := iNdEx + msglen - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if m.StringUser == nil { - m.StringUser = &StringUser{} + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MemoryStats) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent } - if err := m.StringUser.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if iNdEx >= l { + return io.ErrUnexpectedEOF } - iNdEx = postIndex - case 4: + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MemoryStats: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MemoryStats: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Cache", wireType) + } + m.Cache = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Cache |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Usage", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3575,14 +6752,16 @@ func (m *CreateContainerRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Devices = append(m.Devices, &Device{}) - if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Usage == nil { + m.Usage = &MemoryData{} + } + if err := m.Usage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Storages", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SwapUsage", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3606,14 +6785,16 @@ func (m *CreateContainerRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Storages = append(m.Storages, &Storage{}) - if err := m.Storages[len(m.Storages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.SwapUsage == nil { + m.SwapUsage = &MemoryData{} + } + if err := m.SwapUsage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 6: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OCI", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field KernelUsage", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3637,68 +6818,38 @@ func (m *CreateContainerRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.OCI == nil { - m.OCI = &Spec{} + if m.KernelUsage == nil { + m.KernelUsage = &MemoryData{} } - if err := m.OCI.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.KernelUsage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAgent(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthAgent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StartContainerRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAgent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UseHierarchy", wireType) } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StartContainerRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StartContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.UseHierarchy = bool(v != 0) + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAgent @@ -3708,20 +6859,98 @@ func (m *StartContainerRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthAgent } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.ContainerId = string(dAtA[iNdEx:postIndex]) + if m.Stats == nil { + m.Stats = make(map[string]uint64) + } + var mapkey string + var mapvalue uint64 + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthAgent + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapvalue |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + } else { + iNdEx = entryPreIndex + skippy, err := skipAgent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthAgent + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Stats[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -3744,7 +6973,7 @@ func (m *StartContainerRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *RemoveContainerRequest) Unmarshal(dAtA []byte) error { +func (m *BlkioStatsEntry) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3767,15 +6996,53 @@ func (m *RemoveContainerRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RemoveContainerRequest: wiretype end group for non-group") + return fmt.Errorf("proto: BlkioStatsEntry: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: BlkioStatsEntry: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Major", wireType) + } + m.Major = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Major |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Minor", wireType) + } + m.Minor = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Minor |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Op", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3800,13 +7067,13 @@ func (m *RemoveContainerRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ContainerId = string(dAtA[iNdEx:postIndex]) + m.Op = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } - m.Timeout = 0 + m.Value = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAgent @@ -3816,7 +7083,7 @@ func (m *RemoveContainerRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Timeout |= (uint32(b) & 0x7F) << shift + m.Value |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } @@ -3842,7 +7109,7 @@ func (m *RemoveContainerRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { +func (m *BlkioStats) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3865,17 +7132,17 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ExecProcessRequest: wiretype end group for non-group") + return fmt.Errorf("proto: BlkioStats: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ExecProcessRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: BlkioStats: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IoServiceBytesRecursive", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAgent @@ -3885,26 +7152,28 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthAgent } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.ContainerId = string(dAtA[iNdEx:postIndex]) + m.IoServiceBytesRecursive = append(m.IoServiceBytesRecursive, &BlkioStatsEntry{}) + if err := m.IoServiceBytesRecursive[len(m.IoServiceBytesRecursive)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IoServicedRecursive", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAgent @@ -3914,24 +7183,26 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthAgent } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.ExecId = string(dAtA[iNdEx:postIndex]) + m.IoServicedRecursive = append(m.IoServicedRecursive, &BlkioStatsEntry{}) + if err := m.IoServicedRecursive[len(m.IoServicedRecursive)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StringUser", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IoQueuedRecursive", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3955,16 +7226,14 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.StringUser == nil { - m.StringUser = &StringUser{} - } - if err := m.StringUser.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.IoQueuedRecursive = append(m.IoQueuedRecursive, &BlkioStatsEntry{}) + if err := m.IoQueuedRecursive[len(m.IoQueuedRecursive)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Process", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IoServiceTimeRecursive", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3988,68 +7257,16 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Process == nil { - m.Process = &Process{} - } - if err := m.Process.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.IoServiceTimeRecursive = append(m.IoServiceTimeRecursive, &BlkioStatsEntry{}) + if err := m.IoServiceTimeRecursive[len(m.IoServiceTimeRecursive)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAgent(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthAgent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SignalProcessRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAgent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SignalProcessRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SignalProcessRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IoWaitTimeRecursive", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAgent @@ -4059,55 +7276,28 @@ func (m *SignalProcessRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthAgent } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.ContainerId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAgent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAgent - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF + m.IoWaitTimeRecursive = append(m.IoWaitTimeRecursive, &BlkioStatsEntry{}) + if err := m.IoWaitTimeRecursive[len(m.IoWaitTimeRecursive)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.ExecId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Signal", wireType) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IoMergedRecursive", wireType) } - m.Signal = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAgent @@ -4117,66 +7307,28 @@ func (m *SignalProcessRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Signal |= (uint32(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - default: - iNdEx = preIndex - skippy, err := skipAgent(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { + if msglen < 0 { return ErrInvalidLengthAgent } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WaitProcessRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAgent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WaitProcessRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WaitProcessRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IoMergedRecursive = append(m.IoMergedRecursive, &BlkioStatsEntry{}) + if err := m.IoMergedRecursive[len(m.IoMergedRecursive)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IoTimeRecursive", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAgent @@ -4186,26 +7338,28 @@ func (m *WaitProcessRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthAgent } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.ContainerId = string(dAtA[iNdEx:postIndex]) + m.IoTimeRecursive = append(m.IoTimeRecursive, &BlkioStatsEntry{}) + if err := m.IoTimeRecursive[len(m.IoTimeRecursive)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SectorsRecursive", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAgent @@ -4215,20 +7369,22 @@ func (m *WaitProcessRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthAgent } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.ExecId = string(dAtA[iNdEx:postIndex]) + m.SectorsRecursive = append(m.SectorsRecursive, &BlkioStatsEntry{}) + if err := m.SectorsRecursive[len(m.SectorsRecursive)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -4251,7 +7407,7 @@ func (m *WaitProcessRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *WaitProcessResponse) Unmarshal(dAtA []byte) error { +func (m *HugetlbStats) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4274,17 +7430,17 @@ func (m *WaitProcessResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: WaitProcessResponse: wiretype end group for non-group") + return fmt.Errorf("proto: HugetlbStats: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: WaitProcessResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: HugetlbStats: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Usage", wireType) } - m.Status = 0 + m.Usage = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAgent @@ -4294,7 +7450,45 @@ func (m *WaitProcessResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Status |= (int32(b) & 0x7F) << shift + m.Usage |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxUsage", wireType) + } + m.MaxUsage = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxUsage |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Failcnt", wireType) + } + m.Failcnt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Failcnt |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } @@ -4320,7 +7514,7 @@ func (m *WaitProcessResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *ListProcessesRequest) Unmarshal(dAtA []byte) error { +func (m *CgroupStats) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4343,17 +7537,17 @@ func (m *ListProcessesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ListProcessesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: CgroupStats: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ListProcessesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: CgroupStats: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CpuStats", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAgent @@ -4363,26 +7557,30 @@ func (m *ListProcessesRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthAgent } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.ContainerId = string(dAtA[iNdEx:postIndex]) + if m.CpuStats == nil { + m.CpuStats = &CpuStats{} + } + if err := m.CpuStats.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MemoryStats", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAgent @@ -4392,26 +7590,30 @@ func (m *ListProcessesRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthAgent } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Format = string(dAtA[iNdEx:postIndex]) + if m.MemoryStats == nil { + m.MemoryStats = &MemoryStats{} + } + if err := m.MemoryStats.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PidsStats", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAgent @@ -4421,76 +7623,63 @@ func (m *ListProcessesRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthAgent } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Args = append(m.Args, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAgent(dAtA[iNdEx:]) - if err != nil { + if m.PidsStats == nil { + m.PidsStats = &PidsStats{} + } + if err := m.PidsStats.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthAgent + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlkioStats", wireType) } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListProcessesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAgent + if msglen < 0 { + return ErrInvalidLengthAgent } - if iNdEx >= l { + postIndex := iNdEx + msglen + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break + if m.BlkioStats == nil { + m.BlkioStats = &BlkioStats{} } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ListProcessesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListProcessesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + if err := m.BlkioStats.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessList", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HugetlbStats", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAgent @@ -4500,22 +7689,114 @@ func (m *ListProcessesResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthAgent } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.ProcessList = append(m.ProcessList[:0], dAtA[iNdEx:postIndex]...) - if m.ProcessList == nil { - m.ProcessList = []byte{} + if m.HugetlbStats == nil { + m.HugetlbStats = make(map[string]*HugetlbStats) + } + var mapkey string + var mapvalue *HugetlbStats + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthAgent + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthAgent + } + postmsgIndex := iNdEx + mapmsglen + if mapmsglen < 0 { + return ErrInvalidLengthAgent + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &HugetlbStats{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipAgent(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthAgent + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } + m.HugetlbStats[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -4538,7 +7819,7 @@ func (m *ListProcessesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *UpdateContainerRequest) Unmarshal(dAtA []byte) error { +func (m *StatsContainerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4561,44 +7842,15 @@ func (m *UpdateContainerRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: UpdateContainerRequest: wiretype end group for non-group") + return fmt.Errorf("proto: StatsContainerResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: StatsContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAgent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAgent - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContainerId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CgroupStats", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4622,10 +7874,10 @@ func (m *UpdateContainerRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Resources == nil { - m.Resources = &LinuxResources{} + if m.CgroupStats == nil { + m.CgroupStats = &CgroupStats{} } - if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.CgroupStats.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7194,93 +10446,143 @@ var ( func init() { proto.RegisterFile("agent.proto", fileDescriptorAgent) } var fileDescriptorAgent = []byte{ - // 1403 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xdd, 0x6e, 0x1b, 0xb7, - 0x12, 0x3e, 0x6b, 0xc9, 0xb2, 0x35, 0x92, 0x6c, 0x87, 0x76, 0x6c, 0x1d, 0x25, 0xc8, 0x71, 0xf6, - 0x9c, 0x93, 0xb8, 0x05, 0xe2, 0xa0, 0x6e, 0xd1, 0x02, 0x29, 0x8a, 0xd4, 0x51, 0x52, 0xd7, 0x40, - 0x0a, 0x0b, 0x54, 0x8d, 0xf4, 0x4e, 0xa0, 0xb5, 0xb4, 0xcc, 0x56, 0x5a, 0x6e, 0x49, 0xae, 0x7f, - 0x9a, 0xfb, 0x3e, 0x41, 0x1f, 0xa3, 0x77, 0x7d, 0x89, 0x5e, 0x16, 0xe8, 0x0b, 0x14, 0x79, 0x8a, - 0x5e, 0x16, 0xfc, 0x5b, 0x69, 0xe5, 0x95, 0xdb, 0x3a, 0x06, 0x7a, 0xb5, 0x9c, 0x19, 0xee, 0xcc, - 0x37, 0x43, 0x72, 0xe6, 0x83, 0x1a, 0x19, 0xd0, 0x58, 0x6d, 0x27, 0x82, 0x2b, 0x8e, 0xca, 0x03, - 0x91, 0xf4, 0x5b, 0x55, 0xde, 0x67, 0x56, 0xd1, 0xba, 0x33, 0xe0, 0x7c, 0x30, 0xa4, 0x8f, 0x8d, - 0x74, 0x94, 0x1e, 0x3f, 0xa6, 0xa3, 0x44, 0x5d, 0x58, 0x63, 0xf8, 0x7b, 0x00, 0xeb, 0x6d, 0x41, - 0x89, 0xa2, 0x6d, 0x1e, 0x2b, 0xc2, 0x62, 0x2a, 0x30, 0xfd, 0x36, 0xa5, 0x52, 0xa1, 0xfb, 0x50, - 0xef, 0x7b, 0x5d, 0x8f, 0x45, 0xcd, 0x60, 0x33, 0xd8, 0xaa, 0xe2, 0x5a, 0xa6, 0x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0d, 0xec, 0xa4, 0xb0, 0x03, 0xe8, 0x15, 0x61, 0xea, 0xe6, 0x22, 0x85, 0x8f, - 0x60, 0x35, 0xe7, 0x51, 0x26, 0x3c, 0x96, 0xd4, 0x00, 0x50, 0x44, 0xa5, 0xd2, 0x38, 0x9b, 0xc7, - 0x4e, 0x0a, 0x29, 0xac, 0xbd, 0x64, 0xd2, 0x6f, 0xa7, 0x7f, 0x07, 0xc2, 0x3a, 0x54, 0x8e, 0xb9, - 0x18, 0x11, 0xe5, 0x11, 0x58, 0x09, 0x21, 0x28, 0x13, 0x31, 0x90, 0xcd, 0xd2, 0x66, 0x69, 0xab, - 0x8a, 0xcd, 0x5a, 0xdf, 0xca, 0xa9, 0x30, 0x0e, 0xd7, 0x7d, 0xa8, 0xbb, 0xba, 0xf7, 0x86, 0x4c, - 0x2a, 0x13, 0xa7, 0x8e, 0x6b, 0x4e, 0xa7, 0xff, 0x09, 0x39, 0xac, 0x1f, 0x26, 0xd1, 0x35, 0xdf, - 0xf2, 0x0e, 0x54, 0x05, 0x95, 0x3c, 0x15, 0xfa, 0x05, 0xce, 0x99, 0x73, 0x5f, 0xb3, 0xe7, 0xfe, - 0x92, 0xc5, 0xe9, 0x39, 0xf6, 0x36, 0x3c, 0xde, 0x16, 0x46, 0x80, 0x5e, 0x09, 0xa6, 0x68, 0x57, - 0x09, 0x4a, 0x46, 0x37, 0x71, 0xfc, 0x08, 0xca, 0x11, 0x51, 0xc4, 0x1c, 0x7e, 0x1d, 0x9b, 0x75, - 0xf8, 0x10, 0x56, 0x73, 0x51, 0x5c, 0x41, 0x56, 0xa0, 0x34, 0xa4, 0xb1, 0xf1, 0xde, 0xc0, 0x7a, - 0x19, 0x12, 0xb8, 0x85, 0x29, 0x89, 0x6e, 0x0e, 0x8d, 0x0b, 0x51, 0x1a, 0x87, 0xd8, 0x02, 0x34, - 0x19, 0xc2, 0x41, 0xf1, 0xa8, 0x83, 0x09, 0xd4, 0x07, 0x70, 0xab, 0x3d, 0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xc4, 0x75, 0x1c, 0x7c, 0x02, 0x30, 0x66, 0x4f, 0xde, 0xc1, 0x25, 0x3e, 0x75, - 0x45, 0x0d, 0xea, 0x93, 0x5c, 0x09, 0xb9, 0x5c, 0x0b, 0xf8, 0xd3, 0x4c, 0x17, 0x4f, 0xa0, 0x3e, - 0x39, 0x52, 0xbc, 0x8b, 0x82, 0x31, 0xd3, 0x9a, 0x1e, 0x05, 0xe8, 0x53, 0x7f, 0x96, 0x63, 0x55, - 0xee, 0x2c, 0xff, 0x92, 0x87, 0xa9, 0x51, 0x94, 0x7f, 0x6a, 0x7f, 0xee, 0xe1, 0x23, 0xa8, 0x4f, - 0xce, 0x20, 0x8f, 0xbf, 0x60, 0x2e, 0xb5, 0x72, 0x73, 0x48, 0xbf, 0xad, 0x1c, 0xd3, 0xf3, 0x57, - 0xba, 0x88, 0xfe, 0x5d, 0xd5, 0x71, 0xf2, 0xc4, 0xcc, 0x77, 0x9c, 0x42, 0xba, 0x76, 0xd5, 0x39, - 0x4e, 0xce, 0x42, 0x9f, 0x44, 0xc1, 0x7c, 0x9c, 0xe5, 0xe2, 0x59, 0xfd, 0xe7, 0x37, 0xf7, 0x82, - 0x5f, 0xde, 0xdc, 0x0b, 0x7e, 0x7b, 0x73, 0x2f, 0x38, 0xaa, 0x18, 0xeb, 0xfb, 0x7f, 0x04, 0x00, - 0x00, 0xff, 0xff, 0xac, 0xf3, 0x61, 0xb8, 0x33, 0x11, 0x00, 0x00, + // 2196 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xdd, 0x6e, 0x1b, 0xc7, + 0x15, 0x2e, 0x7f, 0x44, 0x89, 0x87, 0xa4, 0x24, 0xae, 0x64, 0x99, 0xa1, 0x0d, 0x57, 0x59, 0xb7, + 0x8e, 0x9a, 0xc0, 0x32, 0xa2, 0x18, 0x6d, 0xe0, 0x20, 0x48, 0x25, 0xd9, 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, 0x6e, + 0x4f, 0x2d, 0x43, 0x6e, 0x95, 0x77, 0x08, 0x37, 0x72, 0xcc, 0xb0, 0x00, 0x57, 0xbd, 0x0a, 0x6e, + 0x2d, 0x83, 0x0b, 0x73, 0xa8, 0x27, 0xb0, 0x46, 0xd9, 0xf0, 0x9b, 0x94, 0xa4, 0x25, 0xa0, 0xda, + 0x55, 0x40, 0x5d, 0xca, 0x7e, 0xad, 0x17, 0xe4, 0x30, 0x03, 0x78, 0xaf, 0xe0, 0xa5, 0xba, 0xee, + 0x05, 0xb0, 0xfa, 0x55, 0x60, 0x1b, 0x99, 0x55, 0x2a, 0x1f, 0xe4, 0x88, 0xbf, 0x84, 0x0d, 0xca, + 0x86, 0xe7, 0x98, 0xca, 0x69, 0xb8, 0x85, 0xb7, 0x38, 0xa9, 0xde, 0xbe, 0x32, 0x96, 0x71, 0x32, + 0x22, 0x7c, 0x54, 0x72, 0xb2, 0xf1, 0x16, 0x27, 0x9f, 0xe9, 0x05, 0x39, 0xcc, 0x2e, 0x74, 0x29, + 0x9b, 0xb6, 0x66, 0xf1, 0x2a, 0x90, 0x15, 0xca, 0xca, 0x96, 0xec, 0x41, 0x57, 0x90, 0x40, 0x32, + 0x5e, 0x3c, 0x04, 0x4b, 0x57, 0x41, 0xac, 0x5a, 0xf9, 0x0c, 0xc3, 0xff, 0x2d, 0xb4, 0x9f, 0xa6, + 0x23, 0x22, 0xc7, 0x27, 0x59, 0x32, 0xb8, 0xb6, 0xfc, 0xe3, 0xff, 0xbb, 0x0a, 0xad, 0xfd, 0x11, + 0x67, 0x69, 0x52, 0xca, 0xc9, 0xe6, 0x92, 0x4e, 0xe7, 0x64, 0x2d, 0xa2, 0x73, 0xb2, 0x11, 0x7e, + 0x08, 0xed, 0x48, 0x5f, 0x5d, 0x2b, 0x6f, 0xf2, 0x50, 0xf7, 0xd2, 0xa5, 0x46, 0xad, 0xa8, 0x90, + 0xcc, 0xb6, 0x01, 0x12, 0x1a, 0x0a, 0xbb, 0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x17, 0x80, 0xcf, 0x01, 0xf2, 0x52, 0xcc, + 0x01, 0x5c, 0x2a, 0xce, 0xe6, 0x06, 0x74, 0x17, 0xda, 0xc5, 0xc2, 0xcb, 0xb3, 0xbe, 0xce, 0x28, + 0xc6, 0xe6, 0x42, 0x3c, 0x82, 0x76, 0xf1, 0x7d, 0x72, 0x10, 0x33, 0xde, 0xac, 0xfe, 0xf4, 0xbb, + 0xe2, 0xfd, 0xdc, 0x1d, 0x8c, 0x9c, 0x55, 0x3a, 0x18, 0xff, 0x13, 0xc2, 0xd4, 0xbb, 0x56, 0xbe, + 0xb7, 0x6f, 0x47, 0xf8, 0x19, 0xb4, 0x8b, 0x0f, 0x9a, 0xb3, 0x7f, 0xc6, 0x23, 0xd7, 0x2f, 0x3d, + 0x6a, 0xea, 0xa2, 0x96, 0xca, 0x46, 0x77, 0x3f, 0x66, 0xd5, 0x92, 0x57, 0xa5, 0xaf, 0x72, 0x95, + 0xe7, 0x4e, 0xf4, 0xcc, 0xda, 0xef, 0xaa, 0x7d, 0x2c, 0x3e, 0xac, 0xce, 0x89, 0x19, 0x8f, 0xed, + 0x3c, 0x88, 0xbd, 0xf6, 0xdf, 0xdf, 0xdc, 0xa9, 0xfc, 0xe3, 0xcd, 0x9d, 0xca, 0xbf, 0xde, 0xdc, + 0xa9, 0x9c, 0x34, 0xf4, 0xec, 0x27, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xcc, 0x2a, 0xfd, 0xa4, + 0x3e, 0x1a, 0x00, 0x00, } diff --git a/virtcontainers/agent.go b/virtcontainers/agent.go index a787ade7b0..e1e0b406cd 100644 --- a/virtcontainers/agent.go +++ b/virtcontainers/agent.go @@ -194,4 +194,7 @@ type agent interface { // This function should be called after hot adding vCPUs or Memory. // cpus specifies the number of CPUs that were added and the agent should online onlineCPUMem(cpus uint32) error + + // statsContainer will tell the agent to get stats from a container related to a Sandbox + statsContainer(sandbox *Sandbox, c Container) (*ContainerStats, error) } diff --git a/virtcontainers/api.go b/virtcontainers/api.go index 5cfb5a23f1..1d439d8cf0 100644 --- a/virtcontainers/api.go +++ b/virtcontainers/api.go @@ -628,3 +628,28 @@ func UpdateContainer(sandboxID, containerID string, resources specs.LinuxResourc return s.UpdateContainer(containerID, resources) } + +// StatsContainer is the virtcontainers container stats entry point. +// StatsContainer returns a detailed container stats. +func StatsContainer(sandboxID, containerID string) (ContainerStats, error) { + if sandboxID == "" { + return ContainerStats{}, errNeedSandboxID + } + + if containerID == "" { + return ContainerStats{}, errNeedContainerID + } + lockFile, err := rLockSandbox(sandboxID) + if err != nil { + return ContainerStats{}, err + } + + defer unlockSandbox(lockFile) + + s, err := fetchSandbox(sandboxID) + if err != nil { + return ContainerStats{}, err + } + + return s.StatsContainer(containerID) +} diff --git a/virtcontainers/api_test.go b/virtcontainers/api_test.go index 0a009f53e7..502302ab9c 100644 --- a/virtcontainers/api_test.go +++ b/virtcontainers/api_test.go @@ -1934,6 +1934,74 @@ func TestStatusContainerFailing(t *testing.T) { } } +func TestStatsContainerFailing(t *testing.T) { + cleanUp() + + contID := "100" + config := newTestSandboxConfigNoop() + + p, err := CreateSandbox(config) + if p == nil || err != nil { + t.Fatal(err) + } + + pImpl, ok := p.(*Sandbox) + assert.True(t, ok) + + os.RemoveAll(pImpl.configPath) + globalSandboxList.removeSandbox(p.ID()) + + _, err = StatsContainer(p.ID(), contID) + if err == nil { + t.Fatal() + } +} + +func TestStatsContainer(t *testing.T) { + cleanUp() + + assert := assert.New(t) + contID := "100" + + _, err := StatsContainer("", "") + assert.Error(err) + + _, err = StatsContainer("abc", "") + assert.Error(err) + + _, err = StatsContainer("abc", "abc") + assert.Error(err) + + config := newTestSandboxConfigNoop() + p, err := CreateSandbox(config) + assert.NoError(err) + assert.NotNil(p) + + p, err = StartSandbox(p.ID()) + if p == nil || err != nil { + t.Fatal(err) + } + + pImpl, ok := p.(*Sandbox) + assert.True(ok) + defer os.RemoveAll(pImpl.configPath) + + contConfig := newTestContainerConfigNoop(contID) + _, c, err := CreateContainer(p.ID(), contConfig) + assert.NoError(err) + assert.NotNil(c) + + _, err = StatsContainer(pImpl.id, "xyz") + assert.Error(err) + + _, err = StatsContainer("xyz", contID) + assert.Error(err) + + stats, err := StatsContainer(pImpl.id, contID) + assert.NoError(err) + assert.Equal(stats, ContainerStats{}) +} + func TestProcessListContainer(t *testing.T) { cleanUp() diff --git a/virtcontainers/container.go b/virtcontainers/container.go index f96cc61d37..bbab96fcbb 100644 --- a/virtcontainers/container.go +++ b/virtcontainers/container.go @@ -1,5 +1,6 @@ +// +build linux // Copyright (c) 2016 Intel Corporation -// +// Copyright (c) 2014,2015,2016,2017 Docker, Inc. // SPDX-License-Identifier: Apache-2.0 // @@ -55,6 +56,119 @@ type ContainerStatus struct { Annotations map[string]string } +// ThrottlingData gather the date related to container cpu throttling. +type ThrottlingData struct { + // Number of periods with throttling active + Periods uint64 `json:"periods,omitempty"` + // Number of periods when the container hit its throttling limit. + ThrottledPeriods uint64 `json:"throttled_periods,omitempty"` + // Aggregate time the container was throttled for in nanoseconds. + ThrottledTime uint64 `json:"throttled_time,omitempty"` +} + +// CPUUsage denotes the usage of a CPU. +// All CPU stats are aggregate since container inception. +type CPUUsage struct { + // Total CPU time consumed. + // Units: nanoseconds. + TotalUsage uint64 `json:"total_usage,omitempty"` + // Total CPU time consumed per core. + // Units: nanoseconds. + PercpuUsage []uint64 `json:"percpu_usage,omitempty"` + // Time spent by tasks of the cgroup in kernel mode. + // Units: nanoseconds. + UsageInKernelmode uint64 `json:"usage_in_kernelmode"` + // Time spent by tasks of the cgroup in user mode. + // Units: nanoseconds. + UsageInUsermode uint64 `json:"usage_in_usermode"` +} + +// CPUStats describes the cpu stats +type CPUStats struct { + CPUUsage CPUUsage `json:"cpu_usage,omitempty"` + ThrottlingData ThrottlingData `json:"throttling_data,omitempty"` +} + +// MemoryData gather the data related to memory +type MemoryData struct { + Usage uint64 `json:"usage,omitempty"` + MaxUsage uint64 `json:"max_usage,omitempty"` + Failcnt uint64 `json:"failcnt"` + Limit uint64 `json:"limit"` +} + +// MemoryStats describes the memory stats +type MemoryStats struct { + // memory used for cache + Cache uint64 `json:"cache,omitempty"` + // usage of memory + Usage MemoryData `json:"usage,omitempty"` + // usage of memory swap + SwapUsage MemoryData `json:"swap_usage,omitempty"` + // usage of kernel memory + KernelUsage MemoryData `json:"kernel_usage,omitempty"` + // usage of kernel TCP memory + KernelTCPUsage MemoryData `json:"kernel_tcp_usage,omitempty"` + // if true, memory usage is accounted for throughout a hierarchy of cgroups. + UseHierarchy bool `json:"use_hierarchy"` + + Stats map[string]uint64 `json:"stats,omitempty"` +} + +// PidsStats describes the pids stats +type PidsStats struct { + // number of pids in the cgroup + Current uint64 `json:"current,omitempty"` + // active pids hard limit + Limit uint64 `json:"limit,omitempty"` +} + +// BlkioStatEntry gather date related to a block device +type BlkioStatEntry struct { + Major uint64 `json:"major,omitempty"` + Minor uint64 `json:"minor,omitempty"` + Op string `json:"op,omitempty"` + Value uint64 `json:"value,omitempty"` +} + +// BlkioStats describes block io stats +type BlkioStats struct { + // number of bytes tranferred to and from the block device + IoServiceBytesRecursive []BlkioStatEntry `json:"io_service_bytes_recursive,omitempty"` + IoServicedRecursive []BlkioStatEntry `json:"io_serviced_recursive,omitempty"` + IoQueuedRecursive []BlkioStatEntry `json:"io_queue_recursive,omitempty"` + IoServiceTimeRecursive []BlkioStatEntry `json:"io_service_time_recursive,omitempty"` + IoWaitTimeRecursive []BlkioStatEntry `json:"io_wait_time_recursive,omitempty"` + IoMergedRecursive []BlkioStatEntry `json:"io_merged_recursive,omitempty"` + IoTimeRecursive []BlkioStatEntry `json:"io_time_recursive,omitempty"` + SectorsRecursive []BlkioStatEntry `json:"sectors_recursive,omitempty"` +} + +// HugetlbStats describes hugetable memory stats +type HugetlbStats struct { + // current res_counter usage for hugetlb + Usage uint64 `json:"usage,omitempty"` + // maximum usage ever recorded. + MaxUsage uint64 `json:"max_usage,omitempty"` + // number of times hugetlb usage allocation failure. + Failcnt uint64 `json:"failcnt"` +} + +// CgroupStats describes all cgroup subsystem stats +type CgroupStats struct { + CPUStats CPUStats `json:"cpu_stats,omitempty"` + MemoryStats MemoryStats `json:"memory_stats,omitempty"` + PidsStats PidsStats `json:"pids_stats,omitempty"` + BlkioStats BlkioStats `json:"blkio_stats,omitempty"` + // the map is in the format "size of hugepage: stats of the hugepage" + HugetlbStats map[string]HugetlbStats `json:"hugetlb_stats,omitempty"` +} + +// ContainerStats describes a container stats. +type ContainerStats struct { + CgroupStats *CgroupStats +} + // ContainerResources describes container resources type ContainerResources struct { // CPUQuota specifies the total amount of time in microseconds @@ -788,6 +902,13 @@ func (c *Container) processList(options ProcessListOptions) (ProcessList, error) return c.sandbox.agent.processListContainer(c.sandbox, *c, options) } +func (c *Container) stats() (*ContainerStats, error) { + if err := c.checkSandboxRunning("stats"); err != nil { + return nil, err + } + return c.sandbox.agent.statsContainer(c.sandbox, *c) +} + func (c *Container) update(resources specs.LinuxResources) error { if err := c.checkSandboxRunning("update"); err != nil { return err diff --git a/virtcontainers/hyperstart_agent.go b/virtcontainers/hyperstart_agent.go index 648acd506e..c62417c0b3 100644 --- a/virtcontainers/hyperstart_agent.go +++ b/virtcontainers/hyperstart_agent.go @@ -609,6 +609,11 @@ func (h *hyper) processListContainer(sandbox *Sandbox, c Container, options Proc return h.processListOneContainer(sandbox.id, c.id, options) } +// statsContainer is the hyperstart agent Container stats implementation. It does nothing. +func (h *hyper) statsContainer(sandbox *Sandbox, c Container) (*ContainerStats, error) { + return &ContainerStats{}, nil +} + func (h *hyper) updateContainer(sandbox *Sandbox, c Container, resources specs.LinuxResources) error { // hyperstart-agent does not support update return nil diff --git a/virtcontainers/implementation.go b/virtcontainers/implementation.go index dba32c5063..81ed6db32f 100644 --- a/virtcontainers/implementation.go +++ b/virtcontainers/implementation.go @@ -106,6 +106,11 @@ func (impl *VCImpl) StatusContainer(sandboxID, containerID string) (ContainerSta return StatusContainer(sandboxID, containerID) } +// StatsContainer implements the VC function of the same name. +func (impl *VCImpl) StatsContainer(sandboxID, containerID string) (ContainerStats, error) { + return StatsContainer(sandboxID, containerID) +} + // KillContainer implements the VC function of the same name. func (impl *VCImpl) KillContainer(sandboxID, containerID string, signal syscall.Signal, all bool) error { return KillContainer(sandboxID, containerID, signal, all) diff --git a/virtcontainers/interfaces.go b/virtcontainers/interfaces.go index c86736232f..f61fd1de07 100644 --- a/virtcontainers/interfaces.go +++ b/virtcontainers/interfaces.go @@ -34,6 +34,7 @@ type VC interface { KillContainer(sandboxID, containerID string, signal syscall.Signal, all bool) error StartContainer(sandboxID, containerID string) (VCContainer, error) StatusContainer(sandboxID, containerID string) (ContainerStatus, error) + StatsContainer(sandboxID, containerID string) (ContainerStats, error) StopContainer(sandboxID, containerID string) (VCContainer, error) ProcessListContainer(sandboxID, containerID string, options ProcessListOptions) (ProcessList, error) UpdateContainer(sandboxID, containerID string, resources specs.LinuxResources) error @@ -59,6 +60,7 @@ type VCSandbox interface { DeleteContainer(contID string) (VCContainer, error) StartContainer(containerID string) (VCContainer, error) StatusContainer(containerID string) (ContainerStatus, error) + StatsContainer(containerID string) (ContainerStats, error) EnterContainer(containerID string, cmd Cmd) (VCContainer, *Process, error) UpdateContainer(containerID string, resources specs.LinuxResources) error WaitProcess(containerID, processID string) (int32, error) diff --git a/virtcontainers/kata_agent.go b/virtcontainers/kata_agent.go index 4deb2c6f3d..70440a2493 100644 --- a/virtcontainers/kata_agent.go +++ b/virtcontainers/kata_agent.go @@ -941,6 +941,38 @@ func (k *kataAgent) onlineCPUMem(cpus uint32) error { return err } +func (k *kataAgent) statsContainer(sandbox *Sandbox, c Container) (*ContainerStats, error) { + req := &grpc.StatsContainerRequest{ + ContainerId: c.id, + } + + returnStats, err := k.sendReq(req) + + if err != nil { + return nil, err + } + + stats, ok := returnStats.(*grpc.StatsContainerResponse) + if !ok { + return nil, fmt.Errorf("irregular response container stats") + } + + data, err := json.Marshal(stats.CgroupStats) + if err != nil { + return nil, err + } + + var cgroupStats CgroupStats + err = json.Unmarshal(data, &cgroupStats) + if err != nil { + return nil, err + } + containerStats := &ContainerStats{ + CgroupStats: &cgroupStats, + } + return containerStats, nil +} + func (k *kataAgent) connect() error { if k.client != nil { return nil @@ -1069,6 +1101,9 @@ func (k *kataAgent) installReqFunc(c *kataclient.AgentClient) { k.reqHandlers["grpc.CloseStdinRequest"] = func(ctx context.Context, req interface{}, opts ...golangGrpc.CallOption) (interface{}, error) { return k.client.CloseStdin(ctx, req.(*grpc.CloseStdinRequest), opts...) } + k.reqHandlers["grpc.StatsContainerRequest"] = func(ctx context.Context, req interface{}, opts ...golangGrpc.CallOption) (interface{}, error) { + return k.client.StatsContainer(ctx, req.(*grpc.StatsContainerRequest), opts...) + } } func (k *kataAgent) sendReq(request interface{}) (interface{}, error) { diff --git a/virtcontainers/kata_agent_test.go b/virtcontainers/kata_agent_test.go index df87ffa73f..41ad8f15d9 100644 --- a/virtcontainers/kata_agent_test.go +++ b/virtcontainers/kata_agent_test.go @@ -199,6 +199,10 @@ func (p *gRPCProxy) OnlineCPUMem(ctx context.Context, req *pb.OnlineCPUMemReques return emptyResp, nil } +func (p *gRPCProxy) StatsContainer(ctx context.Context, req *pb.StatsContainerRequest) (*pb.StatsContainerResponse, error) { + return &pb.StatsContainerResponse{}, nil +} + func (p *gRPCProxy) Check(ctx context.Context, req *pb.CheckRequest) (*pb.HealthCheckResponse, error) { return &pb.HealthCheckResponse{}, nil } @@ -226,6 +230,7 @@ var reqList = []interface{}{ &pb.SignalProcessRequest{}, &pb.CheckRequest{}, &pb.WaitProcessRequest{}, + &pb.StatsContainerRequest{}, } func TestKataAgentSendReq(t *testing.T) { diff --git a/virtcontainers/noop_agent.go b/virtcontainers/noop_agent.go index e437e62c5b..07356f02e9 100644 --- a/virtcontainers/noop_agent.go +++ b/virtcontainers/noop_agent.go @@ -91,6 +91,11 @@ func (n *noopAgent) check() error { return nil } +// statsContainer is the Noop agent Container stats implementation. It does nothing. +func (n *noopAgent) statsContainer(sandbox *Sandbox, c Container) (*ContainerStats, error) { + return &ContainerStats{}, nil +} + // waitProcess is the Noop agent process waiter. It does nothing. func (n *noopAgent) waitProcess(c *Container, processID string) (int32, error) { return 0, nil diff --git a/virtcontainers/noop_agent_test.go b/virtcontainers/noop_agent_test.go index 703c05576a..cd158cbf10 100644 --- a/virtcontainers/noop_agent_test.go +++ b/virtcontainers/noop_agent_test.go @@ -117,3 +117,16 @@ func TestNoopAgentStopContainer(t *testing.T) { t.Fatal(err) } } + +func TestNoopAgentStatsContainer(t *testing.T) { + n := &noopAgent{} + sandbox, container, err := testCreateNoopContainer() + if err != nil { + t.Fatal(err) + } + defer cleanUp() + _, err = n.statsContainer(sandbox, *container) + if err != nil { + t.Fatal(err) + } +} diff --git a/virtcontainers/pkg/vcmock/mock.go b/virtcontainers/pkg/vcmock/mock.go index df9e0170f0..bda162e381 100644 --- a/virtcontainers/pkg/vcmock/mock.go +++ b/virtcontainers/pkg/vcmock/mock.go @@ -179,6 +179,15 @@ func (m *VCMock) StatusContainer(sandboxID, containerID string) (vc.ContainerSta return vc.ContainerStatus{}, fmt.Errorf("%s: %s (%+v): sandboxID: %v, containerID: %v", mockErrorPrefix, getSelf(), m, sandboxID, containerID) } +// StatsContainer implements the VC function of the same name. +func (m *VCMock) StatsContainer(sandboxID, containerID string) (vc.ContainerStats, error) { + if m.StatsContainerFunc != nil { + return m.StatsContainerFunc(sandboxID, containerID) + } + + return vc.ContainerStats{}, fmt.Errorf("%s: %s (%+v): sandboxID: %v, containerID: %v", mockErrorPrefix, getSelf(), m, sandboxID, containerID) +} + // KillContainer implements the VC function of the same name. func (m *VCMock) KillContainer(sandboxID, containerID string, signal syscall.Signal, all bool) error { if m.KillContainerFunc != nil { diff --git a/virtcontainers/pkg/vcmock/mock_test.go b/virtcontainers/pkg/vcmock/mock_test.go index e966b328e7..77537432fe 100644 --- a/virtcontainers/pkg/vcmock/mock_test.go +++ b/virtcontainers/pkg/vcmock/mock_test.go @@ -510,6 +510,33 @@ func TestVCMockStatusContainer(t *testing.T) { assert.True(IsMockError(err)) } +func TestVCMockStatsContainer(t *testing.T) { + assert := assert.New(t) + + m := &VCMock{} + assert.Nil(m.StatsContainerFunc) + + _, err := m.StatsContainer(testSandboxID, testContainerID) + + assert.Error(err) + assert.True(IsMockError(err)) + + m.StatsContainerFunc = func(sandboxID, containerID string) (vc.ContainerStats, error) { + return vc.ContainerStats{}, nil + } + + stats, err := m.StatsContainer(testSandboxID, testContainerID) + assert.NoError(err) + assert.Equal(stats, vc.ContainerStats{}) + + // reset + m.StatsContainerFunc = nil + + _, err = m.StatsContainer(testSandboxID, testContainerID) + assert.Error(err) + assert.True(IsMockError(err)) +} + func TestVCMockStopContainer(t *testing.T) { assert := assert.New(t) diff --git a/virtcontainers/pkg/vcmock/sandbox.go b/virtcontainers/pkg/vcmock/sandbox.go index 25a44c94f6..270958f744 100644 --- a/virtcontainers/pkg/vcmock/sandbox.go +++ b/virtcontainers/pkg/vcmock/sandbox.go @@ -94,6 +94,11 @@ func (p *Sandbox) StatusContainer(contID string) (vc.ContainerStatus, error) { return vc.ContainerStatus{}, nil } +// StatsContainer implements the VCSandbox function of the same name. +func (p *Sandbox) StatsContainer(contID string) (vc.ContainerStats, error) { + return vc.ContainerStats{}, nil +} + // Status implements the VCSandbox function of the same name. func (p *Sandbox) Status() vc.SandboxStatus { return vc.SandboxStatus{} diff --git a/virtcontainers/pkg/vcmock/types.go b/virtcontainers/pkg/vcmock/types.go index 36a6eb38ec..73226c50f8 100644 --- a/virtcontainers/pkg/vcmock/types.go +++ b/virtcontainers/pkg/vcmock/types.go @@ -37,16 +37,17 @@ type Container struct { type VCMock struct { SetLoggerFunc func(logger logrus.FieldLogger) - CreateSandboxFunc func(sandboxConfig vc.SandboxConfig) (vc.VCSandbox, error) - DeleteSandboxFunc func(sandboxID string) (vc.VCSandbox, error) - ListSandboxFunc func() ([]vc.SandboxStatus, error) - FetchSandboxFunc func(sandboxID string) (vc.VCSandbox, error) - PauseSandboxFunc func(sandboxID string) (vc.VCSandbox, error) - ResumeSandboxFunc func(sandboxID string) (vc.VCSandbox, error) - RunSandboxFunc func(sandboxConfig vc.SandboxConfig) (vc.VCSandbox, error) - StartSandboxFunc func(sandboxID string) (vc.VCSandbox, error) - StatusSandboxFunc func(sandboxID string) (vc.SandboxStatus, error) - StopSandboxFunc func(sandboxID string) (vc.VCSandbox, error) + CreateSandboxFunc func(sandboxConfig vc.SandboxConfig) (vc.VCSandbox, error) + DeleteSandboxFunc func(sandboxID string) (vc.VCSandbox, error) + ListSandboxFunc func() ([]vc.SandboxStatus, error) + FetchSandboxFunc func(sandboxID string) (vc.VCSandbox, error) + PauseSandboxFunc func(sandboxID string) (vc.VCSandbox, error) + ResumeSandboxFunc func(sandboxID string) (vc.VCSandbox, error) + RunSandboxFunc func(sandboxConfig vc.SandboxConfig) (vc.VCSandbox, error) + StartSandboxFunc func(sandboxID string) (vc.VCSandbox, error) + StatusSandboxFunc func(sandboxID string) (vc.SandboxStatus, error) + StatsContainerFunc func(sandboxID, containerID string) (vc.ContainerStats, error) + StopSandboxFunc func(sandboxID string) (vc.VCSandbox, error) CreateContainerFunc func(sandboxID string, containerConfig vc.ContainerConfig) (vc.VCSandbox, vc.VCContainer, error) DeleteContainerFunc func(sandboxID, containerID string) (vc.VCContainer, error) diff --git a/virtcontainers/sandbox.go b/virtcontainers/sandbox.go index 823f4bbe4b..556dddb805 100644 --- a/virtcontainers/sandbox.go +++ b/virtcontainers/sandbox.go @@ -1101,6 +1101,21 @@ func (s *Sandbox) UpdateContainer(containerID string, resources specs.LinuxResou return c.update(resources) } +// StatsContainer return the stats of a running container +func (s *Sandbox) StatsContainer(containerID string) (ContainerStats, error) { + // Fetch the container. + c, err := s.findContainer(containerID) + if err != nil { + return ContainerStats{}, err + } + + stats, err := c.stats() + if err != nil { + return ContainerStats{}, err + } + return *stats, nil +} + // createContainers registers all containers to the proxy, create the // containers in the guest and starts one shim per container. func (s *Sandbox) createContainers() error {