Add apiserver profiling to our scalability tests

This commit is contained in:
Shyam Jeedigunta
2018-02-05 17:07:52 +01:00
parent 5320cdeedd
commit c3db0828f9
3 changed files with 47 additions and 0 deletions

View File

@@ -96,10 +96,17 @@ var _ = SIGDescribe("Load capacity", func() {
testCaseBaseName := "load"
var testPhaseDurations *timer.TestPhaseTimer
var profileGathererStopCh chan struct{}
// Gathers metrics before teardown
// TODO add flag that allows to skip cleanup on failure
AfterEach(func() {
// Stop apiserver CPU profile gatherer and gather memory allocations profile.
close(profileGathererStopCh)
wg := sync.WaitGroup{}
framework.GatherApiserverMemoryProfile(&wg, "load")
wg.Wait()
// Verify latency metrics
highLatencyRequests, metrics, err := framework.HighLatencyRequests(clientset, nodeCount)
framework.ExpectNoError(err)
@@ -147,6 +154,10 @@ var _ = SIGDescribe("Load capacity", func() {
framework.ExpectNoError(err)
framework.ExpectNoError(framework.ResetMetrics(clientset))
// Start apiserver CPU profile gatherer with frequency based on cluster size.
profileGatheringDelay := time.Duration(5+nodeCount/100) * time.Minute
profileGathererStopCh = framework.StartApiserverCPUProfileGatherer(profileGatheringDelay)
})
type Load struct {