Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
c3db0828
Unverified
Commit
c3db0828
authored
Feb 05, 2018
by
Shyam Jeedigunta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add apiserver profiling to our scalability tests
parent
5320cdee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
0 deletions
+47
-0
profile_gatherer.go
test/e2e/framework/profile_gatherer.go
+25
-0
density.go
test/e2e/scalability/density.go
+11
-0
load.go
test/e2e/scalability/load.go
+11
-0
No files found.
test/e2e/framework/profile_gatherer.go
View file @
c3db0828
...
...
@@ -24,6 +24,7 @@ import (
"path"
"strings"
"sync"
"time"
)
const
(
...
...
@@ -140,6 +141,9 @@ func GatherApiserverCPUProfileForNSeconds(wg *sync.WaitGroup, profileBaseName st
if
wg
!=
nil
{
defer
wg
.
Done
()
}
if
profileBaseName
==
""
{
profileBaseName
=
time
.
Now
()
.
Format
(
time
.
RFC3339
)
}
if
err
:=
gatherProfileOfKind
(
profileBaseName
,
fmt
.
Sprintf
(
"profile?seconds=%v"
,
n
));
err
!=
nil
{
Logf
(
"Failed to gather apiserver CPU profile: %v"
,
err
)
}
...
...
@@ -149,7 +153,28 @@ func GatherApiserverMemoryProfile(wg *sync.WaitGroup, profileBaseName string) {
if
wg
!=
nil
{
defer
wg
.
Done
()
}
if
profileBaseName
==
""
{
profileBaseName
=
time
.
Now
()
.
Format
(
time
.
RFC3339
)
}
if
err
:=
gatherProfileOfKind
(
profileBaseName
,
"heap"
);
err
!=
nil
{
Logf
(
"Failed to gather apiserver memory profile: %v"
,
err
)
}
}
// StartApiserverCPUProfileGatherer is a polling-based gatherer of the apiserver's
// CPU profile. It takes the delay b/w consecutive gatherings as an argument and
// starts the gathering goroutine. To stop the gatherer, close the returned channel.
func
StartApiserverCPUProfileGatherer
(
delay
time
.
Duration
)
chan
struct
{}
{
stopCh
:=
make
(
chan
struct
{})
go
func
()
{
for
{
select
{
case
<-
time
.
After
(
delay
)
:
GatherApiserverCPUProfile
(
nil
,
""
)
case
<-
stopCh
:
return
}
}
}()
return
stopCh
}
test/e2e/scalability/density.go
View file @
c3db0828
...
...
@@ -356,9 +356,16 @@ var _ = SIGDescribe("Density", func() {
testCaseBaseName
:=
"density"
missingMeasurements
:=
0
var
testPhaseDurations
*
timer
.
TestPhaseTimer
var
profileGathererStopCh
chan
struct
{}
// Gathers data prior to framework namespace teardown
AfterEach
(
func
()
{
// Stop apiserver CPU profile gatherer and gather memory allocations profile.
close
(
profileGathererStopCh
)
wg
:=
sync
.
WaitGroup
{}
framework
.
GatherApiserverMemoryProfile
(
&
wg
,
"density"
)
wg
.
Wait
()
saturationThreshold
:=
time
.
Duration
((
totalPods
/
MinPodsPerSecondThroughput
))
*
time
.
Second
if
saturationThreshold
<
MinSaturationThreshold
{
saturationThreshold
=
MinSaturationThreshold
...
...
@@ -442,6 +449,10 @@ var _ = SIGDescribe("Density", func() {
}
framework
.
Logf
(
"Name: %v, clusterIP: %v, externalIP: %v"
,
node
.
ObjectMeta
.
Name
,
internalIP
,
externalIP
)
}
// Start apiserver CPU profile gatherer with frequency based on cluster size.
profileGatheringDelay
:=
time
.
Duration
(
5
+
nodeCount
/
100
)
*
time
.
Minute
profileGathererStopCh
=
framework
.
StartApiserverCPUProfileGatherer
(
profileGatheringDelay
)
})
type
Density
struct
{
...
...
test/e2e/scalability/load.go
View file @
c3db0828
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment