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
c9abcfa5
Commit
c9abcfa5
authored
Feb 26, 2016
by
gmarek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a cluster saturation time check to the Density test
parent
f15d8528
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
4 deletions
+32
-4
density.go
test/e2e/density.go
+24
-3
metrics_util.go
test/e2e/metrics_util.go
+8
-1
No files found.
test/e2e/density.go
View file @
c9abcfa5
...
...
@@ -41,7 +41,11 @@ import (
)
// NodeStartupThreshold is a rough estimate of the time allocated for a pod to start on a node.
const
NodeStartupThreshold
=
4
*
time
.
Second
const
(
NodeStartupThreshold
=
4
*
time
.
Second
MinSaturationThreshold
=
2
*
time
.
Minute
MinPodsPerSecondThroughput
=
10
)
// Maximum container failures this test tolerates before failing.
var
MaxContainerFailures
=
0
...
...
@@ -115,9 +119,19 @@ var _ = Describe("Density", func() {
var
additionalPodsPrefix
string
var
ns
string
var
uuid
string
var
e2eStartupTime
time
.
Duration
var
totalPods
int
// Gathers data prior to framework namespace teardown
AfterEach
(
func
()
{
saturationData
:=
SaturationTime
{
TimeToSaturate
:
e2eStartupTime
,
NumberOfNodes
:
nodeCount
,
NumberOfPods
:
totalPods
,
Throughput
:
float32
(
totalPods
)
/
float32
(
e2eStartupTime
/
time
.
Second
),
}
Logf
(
"Cluster saturation time: %s"
,
prettyPrintJSON
(
saturationData
))
// Verify latency metrics.
highLatencyRequests
,
err
:=
HighLatencyRequests
(
c
)
expectNoError
(
err
)
...
...
@@ -204,7 +218,7 @@ var _ = Describe("Density", func() {
}
itArg
:=
testArg
It
(
name
,
func
()
{
totalPods
:
=
itArg
.
podsPerNode
*
nodeCount
totalPods
=
itArg
.
podsPerNode
*
nodeCount
RCName
=
"density"
+
strconv
.
Itoa
(
totalPods
)
+
"-"
+
uuid
fileHndl
,
err
:=
os
.
Create
(
fmt
.
Sprintf
(
testContext
.
OutputDir
+
"/%s/pod_states.csv"
,
uuid
))
expectNoError
(
err
)
...
...
@@ -276,8 +290,9 @@ var _ = Describe("Density", func() {
// Start the replication controller.
startTime
:=
time
.
Now
()
expectNoError
(
RunRC
(
config
))
e2eStartupTime
:
=
time
.
Now
()
.
Sub
(
startTime
)
e2eStartupTime
=
time
.
Now
()
.
Sub
(
startTime
)
Logf
(
"E2E startup time for %d pods: %v"
,
totalPods
,
e2eStartupTime
)
Logf
(
"Throughput during cluster saturation phase: %v"
,
float32
(
totalPods
)
/
float32
(
e2eStartupTime
))
By
(
"Waiting for all events to be recorded"
)
last
:=
-
1
...
...
@@ -484,6 +499,12 @@ var _ = Describe("Density", func() {
name
:=
additionalPodsPrefix
+
"-"
+
strconv
.
Itoa
(
i
)
c
.
Pods
(
ns
)
.
Delete
(
name
,
nil
)
}
saturationThreshold
:=
time
.
Duration
((
totalPods
/
MinPodsPerSecondThroughput
))
*
time
.
Second
if
saturationThreshold
<
MinSaturationThreshold
{
saturationThreshold
=
MinSaturationThreshold
}
Expect
(
e2eStartupTime
)
.
NotTo
(
BeNumerically
(
">"
,
saturationThreshold
))
})
}
})
...
...
test/e2e/metrics_util.go
View file @
c9abcfa5
...
...
@@ -124,11 +124,18 @@ type PodStartupLatency struct {
}
type
SchedulingLatency
struct
{
Scheduling
LatencyMetric
`json:"scheduling
:
`
Scheduling
LatencyMetric
`json:"scheduling
"
`
Binding
LatencyMetric
`json:"binding"`
Total
LatencyMetric
`json:"total"`
}
type
SaturationTime
struct
{
TimeToSaturate
time
.
Duration
`json:"timeToStaturate"`
NumberOfNodes
int
`json:"numberOfNodes"`
NumberOfPods
int
`json:"numberOfPods"`
Throughput
float32
`json:"throughput"`
}
type
APICall
struct
{
Resource
string
`json:"resource"`
Verb
string
`json:"verb"`
...
...
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