Add resource monitoring of kube-system pods

This commit is contained in:
gmarek
2015-10-29 15:49:23 +01:00
parent fcbf1c1012
commit cfe391d4ee
5 changed files with 211 additions and 11 deletions

View File

@@ -39,6 +39,11 @@ type Framework struct {
Namespace *api.Namespace
Client *client.Client
NamespaceDeletionTimeout time.Duration
// If set to true framework will start a goroutine monitoring resource usage of system add-ons.
// It will read the data every 30 seconds from all Nodes and print summary during afterEach.
GatherKubeSystemResourceUsageData bool
gatherer containerResourceGatherer
}
// NewFramework makes a new framework and sets up a BeforeEach/AfterEach for
@@ -75,6 +80,10 @@ func (f *Framework) beforeEach() {
} else {
Logf("Skipping waiting for service account")
}
if f.GatherKubeSystemResourceUsageData {
f.gatherer.startGatheringData(c, time.Minute)
}
}
// afterEach deletes the namespace, after reading its events.
@@ -113,6 +122,10 @@ func (f *Framework) afterEach() {
} else {
Logf("Found DeleteNamespace=false, skipping namespace deletion!")
}
if f.GatherKubeSystemResourceUsageData {
f.gatherer.stopAndPrintData([]int{50, 90, 99, 100})
}
// Paranoia-- prevent reuse!
f.Namespace = nil
f.Client = nil