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
70500a64
Commit
70500a64
authored
May 22, 2015
by
Filip Grzadkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Added metrics/debug gathering methods to utils and used them in density ..."
parent
a823f6d1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
118 deletions
+9
-118
density.go
test/e2e/density.go
+7
-27
fifo_queue.go
test/e2e/fifo_queue.go
+0
-75
load.go
test/e2e/load.go
+1
-7
scale.go
test/e2e/scale.go
+1
-9
util.go
test/e2e/util.go
+0
-0
No files found.
test/e2e/density.go
View file @
70500a64
...
...
@@ -19,7 +19,6 @@ package e2e
import
(
"fmt"
"math"
"os"
"strconv"
"time"
...
...
@@ -46,7 +45,6 @@ var _ = Describe("Density", func() {
var
minionCount
int
var
RCName
string
var
ns
string
var
uuid
string
BeforeEach
(
func
()
{
var
err
error
...
...
@@ -59,9 +57,6 @@ var _ = Describe("Density", func() {
nsForTesting
,
err
:=
createTestingNS
(
"density"
,
c
)
ns
=
nsForTesting
.
Name
expectNoError
(
err
)
uuid
=
string
(
util
.
NewUUID
())
expectNoError
(
os
.
Mkdir
(
uuid
,
0777
))
expectNoError
(
writePerfData
(
c
,
uuid
,
"before"
))
})
AfterEach
(
func
()
{
...
...
@@ -81,8 +76,6 @@ var _ = Describe("Density", func() {
Failf
(
"Couldn't delete ns %s"
,
err
)
}
expectNoError
(
writePerfData
(
c
,
uuid
,
"after"
))
// Verify latency metrics
// TODO: Update threshold to 1s once we reach this goal
// TODO: We should reset metrics before the test. Currently previous tests influence latency metrics.
...
...
@@ -96,18 +89,16 @@ var _ = Describe("Density", func() {
type
Density
struct
{
skip
bool
podsPerMinion
int
/* Controls how often the apiserver is polled for pods */
interval
int
}
densityTests
:=
[]
Density
{
// This test should always run, even if larger densities are skipped.
{
podsPerMinion
:
3
,
skip
:
false
,
interval
:
10
},
{
podsPerMinion
:
30
,
skip
:
false
,
interval
:
10
},
{
podsPerMinion
:
3
,
skip
:
false
},
{
podsPerMinion
:
30
,
skip
:
false
},
// More than 30 pods per node is outside our v1.0 goals.
// We might want to enable those tests in the future.
{
podsPerMinion
:
50
,
skip
:
true
,
interval
:
10
},
{
podsPerMinion
:
100
,
skip
:
true
,
interval
:
1
},
{
podsPerMinion
:
50
,
skip
:
true
},
{
podsPerMinion
:
100
,
skip
:
true
},
}
for
_
,
testArg
:=
range
densityTests
{
...
...
@@ -121,19 +112,8 @@ var _ = Describe("Density", func() {
itArg
:=
testArg
It
(
name
,
func
()
{
totalPods
:=
itArg
.
podsPerMinion
*
minionCount
RCName
=
"density"
+
strconv
.
Itoa
(
totalPods
)
+
"-"
+
uuid
fileHndl
,
err
:=
os
.
Create
(
fmt
.
Sprintf
(
"%s/pod_states.csv"
,
uuid
))
expectNoError
(
err
)
defer
fileHndl
.
Close
()
config
:=
RCConfig
{
Client
:
c
,
Image
:
"gcr.io/google_containers/pause:go"
,
Name
:
RCName
,
Namespace
:
ns
,
PollInterval
:
itArg
.
interval
,
PodStatusFile
:
fileHndl
,
Replicas
:
totalPods
,
}
nameStr
:=
strconv
.
Itoa
(
totalPods
)
+
"-"
+
string
(
util
.
NewUUID
())
RCName
=
"my-hostname-density"
+
nameStr
// Create a listener for events.
events
:=
make
([](
*
api
.
Event
),
0
)
...
...
@@ -159,7 +139,7 @@ var _ = Describe("Density", func() {
// Start the replication controller.
startTime
:=
time
.
Now
()
expectNoError
(
RunRC
(
c
onfig
))
expectNoError
(
RunRC
(
c
,
RCName
,
ns
,
"gcr.io/google_containers/pause:go"
,
totalPods
))
e2eStartupTime
:=
time
.
Now
()
.
Sub
(
startTime
)
Logf
(
"E2E startup time for %d pods: %v"
,
totalPods
,
e2eStartupTime
)
...
...
test/e2e/fifo_queue.go
deleted
100644 → 0
View file @
a823f6d1
/*
Copyright 2014 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
e2e
import
(
"sync"
"time"
)
type
QueueItem
struct
{
createTime
string
value
interface
{}
}
type
QueueItems
struct
{
pos
int
mutex
*
sync
.
Mutex
list
[]
QueueItem
}
type
FifoQueue
QueueItems
func
(
fq
*
FifoQueue
)
Push
(
elem
interface
{})
{
fq
.
mutex
.
Lock
()
fq
.
list
=
append
(
fq
.
list
,
QueueItem
{
time
.
Now
()
.
String
(),
elem
})
fq
.
mutex
.
Unlock
()
}
func
(
fq
*
FifoQueue
)
Pop
()
QueueItem
{
fq
.
mutex
.
Lock
()
var
val
QueueItem
if
len
(
fq
.
list
)
-
1
>=
fq
.
pos
{
val
=
fq
.
list
[
fq
.
pos
]
fq
.
pos
++
}
fq
.
mutex
.
Unlock
()
return
val
}
func
(
fq
FifoQueue
)
Len
()
int
{
return
len
(
fq
.
list
[
fq
.
pos
:
])
}
func
(
fq
*
FifoQueue
)
First
()
QueueItem
{
return
fq
.
list
[
fq
.
pos
]
}
func
(
fq
*
FifoQueue
)
Last
()
QueueItem
{
return
fq
.
list
[
len
(
fq
.
list
)
-
1
]
}
func
(
fq
*
FifoQueue
)
Reset
()
{
fq
.
pos
=
0
}
func
newFifoQueue
()
*
FifoQueue
{
tmp
:=
new
(
FifoQueue
)
tmp
.
mutex
=
&
sync
.
Mutex
{}
tmp
.
pos
=
0
return
tmp
}
test/e2e/load.go
View file @
70500a64
...
...
@@ -120,13 +120,7 @@ func playWithRC(c *client.Client, wg *sync.WaitGroup, ns, name string, size int)
// Once every 1-2 minutes perform resize of RC.
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
simulationTime
;
time
.
Sleep
(
time
.
Duration
(
60
+
rand
.
Intn
(
60
))
*
time
.
Second
)
{
if
!
rcExist
{
config
:=
RCConfig
{
Client
:
c
,
Name
:
name
,
Namespace
:
ns
,
Image
:
image
,
Replicas
:
size
,
}
expectNoError
(
RunRC
(
config
),
fmt
.
Sprintf
(
"creating rc %s in namespace %s"
,
name
,
ns
))
expectNoError
(
RunRC
(
c
,
name
,
ns
,
image
,
size
),
fmt
.
Sprintf
(
"creating rc %s in namespace %s"
,
name
,
ns
))
rcExist
=
true
}
// Resize RC to a random size between 0.5x and 1.5x of the original size.
...
...
test/e2e/scale.go
View file @
70500a64
...
...
@@ -107,15 +107,7 @@ var _ = Describe("Scale", func() {
for
i
:=
0
;
i
<
itArg
.
rcsPerThread
;
i
++
{
name
:=
"my-short-lived-pod"
+
string
(
util
.
NewUUID
())
n
:=
itArg
.
podsPerMinion
*
minionCount
config
:=
RCConfig
{
Client
:
c
,
Name
:
name
,
Namespace
:
ns
,
Image
:
"gcr.io/google_containers/pause:go"
,
Replicas
:
n
,
}
expectNoError
(
RunRC
(
config
))
expectNoError
(
RunRC
(
c
,
name
,
ns
,
"gcr.io/google_containers/pause:go"
,
n
))
podsLaunched
+=
n
Logf
(
"Launched %v pods so far..."
,
podsLaunched
)
err
:=
DeleteRC
(
c
,
ns
,
name
)
...
...
test/e2e/util.go
View file @
70500a64
This diff is collapsed.
Click to expand it.
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