Commit a8c68592 authored by Yu-Ju Hong's avatar Yu-Ju Hong

e2e: adapt kubelet_perf.go to use the new summary metrics API

This commit switch most functions in kubelet_stats.go to use the new API. However, the functions that perform one-time resource usage retrieval remain unchanged to be compatible with reource_usage_gatherer.go. They should be handled separately. Also, the new summary API does not provide the RSS memory yet, so all memory checking tests will *always* pass. We plan to add this metrics in the API and restore the functionality of the test.
parent e93c0d72
...@@ -22,6 +22,7 @@ import ( ...@@ -22,6 +22,7 @@ import (
"time" "time"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/stats"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
...@@ -31,7 +32,7 @@ import ( ...@@ -31,7 +32,7 @@ import (
const ( const (
// Interval to poll /stats/container on a node // Interval to poll /stats/container on a node
containerStatsPollingPeriod = 3 * time.Second containerStatsPollingPeriod = 10 * time.Second
// The monitoring time for one test. // The monitoring time for one test.
monitoringTime = 20 * time.Minute monitoringTime = 20 * time.Minute
// The periodic reporting period. // The periodic reporting period.
...@@ -210,27 +211,26 @@ var _ = KubeDescribe("Kubelet [Serial] [Slow]", func() { ...@@ -210,27 +211,26 @@ var _ = KubeDescribe("Kubelet [Serial] [Slow]", func() {
{ {
podsPerNode: 0, podsPerNode: 0,
cpuLimits: containersCPUSummary{ cpuLimits: containersCPUSummary{
"/kubelet": {0.50: 0.06, 0.95: 0.08}, stats.SystemContainerKubelet: {0.50: 0.06, 0.95: 0.08},
"/docker-daemon": {0.50: 0.05, 0.95: 0.06}, stats.SystemContainerRuntime: {0.50: 0.05, 0.95: 0.06},
}, },
// We set the memory limits generously because the distribution // We set the memory limits generously because the distribution
// of the addon pods affect the memory usage on each node. // of the addon pods affect the memory usage on each node.
memLimits: resourceUsagePerContainer{ memLimits: resourceUsagePerContainer{
"/kubelet": &containerResourceUsage{MemoryRSSInBytes: 70 * 1024 * 1024}, stats.SystemContainerKubelet: &containerResourceUsage{MemoryRSSInBytes: 70 * 1024 * 1024},
"/docker-daemon": &containerResourceUsage{MemoryRSSInBytes: 85 * 1024 * 1024}, stats.SystemContainerRuntime: &containerResourceUsage{MemoryRSSInBytes: 85 * 1024 * 1024},
}, },
}, },
{ {
podsPerNode: 35, podsPerNode: 35,
cpuLimits: containersCPUSummary{ cpuLimits: containersCPUSummary{
"/kubelet": {0.50: 0.12, 0.95: 0.14}, stats.SystemContainerKubelet: {0.50: 0.12, 0.95: 0.14},
"/docker-daemon": {0.50: 0.06, 0.95: 0.08}, stats.SystemContainerRuntime: {0.50: 0.06, 0.95: 0.08},
}, },
// We set the memory limits generously because the distribution // We set the memory limits generously because the distribution
// of the addon pods affect the memory usage on each node. // of the addon pods affect the memory usage on each node.
memLimits: resourceUsagePerContainer{ memLimits: resourceUsagePerContainer{
"/kubelet": &containerResourceUsage{MemoryRSSInBytes: 75 * 1024 * 1024}, stats.SystemContainerRuntime: &containerResourceUsage{MemoryRSSInBytes: 100 * 1024 * 1024},
"/docker-daemon": &containerResourceUsage{MemoryRSSInBytes: 100 * 1024 * 1024},
}, },
}, },
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment