From e4d403193f82d0cd4e86ce83751c487b1d632624 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Fri, 9 Nov 2018 09:29:26 -0800 Subject: [PATCH] remove unused interface method --- metrics/prometheus.go | 3 --- metrics/prometheus_test.go | 28 ---------------------------- 2 files changed, 31 deletions(-) diff --git a/metrics/prometheus.go b/metrics/prometheus.go index 54f79406..38502743 100644 --- a/metrics/prometheus.go +++ b/metrics/prometheus.go @@ -21,7 +21,6 @@ import ( "github.com/google/cadvisor/container" info "github.com/google/cadvisor/info/v1" - "github.com/google/cadvisor/info/v2" "github.com/prometheus/client_golang/prometheus" "k8s.io/klog" @@ -36,8 +35,6 @@ type infoProvider interface { GetVersionInfo() (*info.VersionInfo, error) // GetMachineInfo provides information about the machine. GetMachineInfo() (*info.MachineInfo, error) - // GetProcessList provides information about each container's processes - GetProcessList(containerName string, options v2.RequestOptions) ([]v2.ProcessInfo, error) } // metricValue describes a single metric value for a given set of label values diff --git a/metrics/prometheus_test.go b/metrics/prometheus_test.go index 38b5df0f..49810c4a 100644 --- a/metrics/prometheus_test.go +++ b/metrics/prometheus_test.go @@ -26,7 +26,6 @@ import ( "github.com/google/cadvisor/container" info "github.com/google/cadvisor/info/v1" - "github.com/google/cadvisor/info/v2" "github.com/prometheus/client_golang/prometheus" ) @@ -50,26 +49,6 @@ func (p testSubcontainersInfoProvider) GetMachineInfo() (*info.MachineInfo, erro }, nil } -func (p testSubcontainersInfoProvider) GetProcessList(containerName string, options v2.RequestOptions) ([]v2.ProcessInfo, error) { - return []v2.ProcessInfo{ - { - User: "user1", - Pid: 1, - Ppid: 2, - StartTime: "OCT2018", - PercentCpu: 0.0, - PercentMemory: 0.0, - RSS: 3, - VirtualSize: 4, - Status: "S", - RunningTime: "00:00:00", - Cmd: "cmd1", - CgroupPath: "path", - FdCount: 5, - }, - }, nil -} - var allMetrics = container.MetricSet{ container.CpuUsageMetrics: struct{}{}, container.ProcessSchedulerMetrics: struct{}{}, @@ -331,13 +310,6 @@ func (p *erroringSubcontainersInfoProvider) GetMachineInfo() (*info.MachineInfo, return p.successfulProvider.GetMachineInfo() } -func (p *erroringSubcontainersInfoProvider) GetProcessList(containerName string, options v2.RequestOptions) ([]v2.ProcessInfo, error) { - if p.shouldFail { - return nil, errors.New("Oops 2") - } - return p.successfulProvider.GetProcessList(containerName, options) -} - func (p *erroringSubcontainersInfoProvider) SubcontainersInfo( a string, r *info.ContainerInfoRequest) ([]*info.ContainerInfo, error) { if p.shouldFail {