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
9fce56c1
Commit
9fce56c1
authored
Feb 09, 2016
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix timeouts in load test
parent
c78f3a68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
load.go
test/e2e/load.go
+13
-8
No files found.
test/e2e/load.go
View file @
9fce56c1
...
...
@@ -132,11 +132,17 @@ var _ = Describe("Load capacity", func() {
// We may want to revisit it in the future.
creatingTime
:=
time
.
Duration
(
totalPods
/
5
)
*
time
.
Second
createAllRC
(
configs
,
creatingTime
)
By
(
"============================================================================"
)
scaleAllRC
(
configs
)
// We would like to spread scaling replication controllers over time
// to make it possible to create/schedule & delete them in the meantime.
// Currently we assume that 5 pods/second average throughput.
// The expected number of created/deleted pods is less than totalPods/3.
scalingTime
:=
time
.
Duration
(
totalPods
/
15
)
*
time
.
Second
scaleAllRC
(
configs
,
scalingTime
)
By
(
"============================================================================"
)
scaleAllRC
(
configs
)
scaleAllRC
(
configs
,
scalingTime
)
By
(
"============================================================================"
)
// Cleanup all created replication controllers.
...
...
@@ -211,23 +217,22 @@ func createRC(wg *sync.WaitGroup, config *RCConfig, creatingTime time.Duration)
expectNoError
(
RunRC
(
*
config
),
fmt
.
Sprintf
(
"creating rc %s"
,
config
.
Name
))
}
func
scaleAllRC
(
configs
[]
*
RCConfig
)
{
func
scaleAllRC
(
configs
[]
*
RCConfig
,
scalingTime
time
.
Duration
)
{
var
wg
sync
.
WaitGroup
wg
.
Add
(
len
(
configs
))
for
_
,
config
:=
range
configs
{
go
scaleRC
(
&
wg
,
config
)
go
scaleRC
(
&
wg
,
config
,
scalingTime
)
}
wg
.
Wait
()
}
// Scales RC to a random size within [0.5*size, 1.5*size] and lists all the pods afterwards.
// Scaling happens always based on original size, not the current size.
func
scaleRC
(
wg
*
sync
.
WaitGroup
,
config
*
RCConfig
)
{
func
scaleRC
(
wg
*
sync
.
WaitGroup
,
config
*
RCConfig
,
scalingTime
time
.
Duration
)
{
defer
GinkgoRecover
()
defer
wg
.
Done
()
resizingTime
:=
3
*
time
.
Minute
sleepUpTo
(
resiz
ingTime
)
sleepUpTo
(
scal
ingTime
)
newSize
:=
uint
(
rand
.
Intn
(
config
.
Replicas
)
+
config
.
Replicas
/
2
)
expectNoError
(
ScaleRC
(
config
.
Client
,
config
.
Namespace
,
config
.
Name
,
newSize
,
true
),
fmt
.
Sprintf
(
"scaling rc %s for the first time"
,
config
.
Name
))
...
...
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