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
fbb83a45
Commit
fbb83a45
authored
Jun 24, 2015
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10218 from wojtek-t/reset_metrics_before_tests
Reset latency metrics before starting scalability tests
parents
f4e7b548
2a1834f7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
6 deletions
+16
-6
density.go
test/e2e/density.go
+1
-5
load.go
test/e2e/load.go
+2
-1
util.go
test/e2e/util.go
+13
-0
No files found.
test/e2e/density.go
View file @
fbb83a45
...
@@ -98,11 +98,7 @@ var _ = Describe("Density", func() {
...
@@ -98,11 +98,7 @@ var _ = Describe("Density", func() {
expectNoError
(
err
)
expectNoError
(
err
)
uuid
=
string
(
util
.
NewUUID
())
uuid
=
string
(
util
.
NewUUID
())
// Print latency metrics before the test.
expectNoError
(
resetMetrics
(
c
))
// TODO: Remove this once we reset metrics before the test.
_
,
err
=
HighLatencyRequests
(
c
,
3
*
time
.
Second
,
util
.
NewStringSet
(
"events"
))
expectNoError
(
err
)
expectNoError
(
os
.
Mkdir
(
fmt
.
Sprintf
(
testContext
.
OutputDir
+
"/%s"
,
uuid
),
0777
))
expectNoError
(
os
.
Mkdir
(
fmt
.
Sprintf
(
testContext
.
OutputDir
+
"/%s"
,
uuid
),
0777
))
expectNoError
(
writePerfData
(
c
,
fmt
.
Sprintf
(
testContext
.
OutputDir
+
"/%s"
,
uuid
),
"before"
))
expectNoError
(
writePerfData
(
c
,
fmt
.
Sprintf
(
testContext
.
OutputDir
+
"/%s"
,
uuid
),
"before"
))
})
})
...
...
test/e2e/load.go
View file @
fbb83a45
...
@@ -73,6 +73,8 @@ var _ = Describe("Load capacity", func() {
...
@@ -73,6 +73,8 @@ var _ = Describe("Load capacity", func() {
nsForTesting
,
err
:=
createTestingNS
(
"load"
,
c
)
nsForTesting
,
err
:=
createTestingNS
(
"load"
,
c
)
ns
=
nsForTesting
.
Name
ns
=
nsForTesting
.
Name
expectNoError
(
err
)
expectNoError
(
err
)
expectNoError
(
resetMetrics
(
c
))
})
})
// TODO add flag that allows to skip cleanup on failure
// TODO add flag that allows to skip cleanup on failure
...
@@ -85,7 +87,6 @@ var _ = Describe("Load capacity", func() {
...
@@ -85,7 +87,6 @@ var _ = Describe("Load capacity", func() {
}
}
// Verify latency metrics
// Verify latency metrics
// TODO: We should reset metrics before the test. Currently previous tests influence latency metrics.
highLatencyRequests
,
err
:=
HighLatencyRequests
(
c
,
1
*
time
.
Second
,
util
.
NewStringSet
(
"events"
))
highLatencyRequests
,
err
:=
HighLatencyRequests
(
c
,
1
*
time
.
Second
,
util
.
NewStringSet
(
"events"
))
expectNoError
(
err
,
"Too many instances metrics above the threshold"
)
expectNoError
(
err
,
"Too many instances metrics above the threshold"
)
Expect
(
highLatencyRequests
)
.
NotTo
(
BeNumerically
(
">"
,
0
))
Expect
(
highLatencyRequests
)
.
NotTo
(
BeNumerically
(
">"
,
0
))
...
...
test/e2e/util.go
View file @
fbb83a45
...
@@ -1395,6 +1395,19 @@ func HighLatencyRequests(c *client.Client, threshold time.Duration, ignoredResou
...
@@ -1395,6 +1395,19 @@ func HighLatencyRequests(c *client.Client, threshold time.Duration, ignoredResou
return
len
(
badMetrics
),
nil
return
len
(
badMetrics
),
nil
}
}
// Reset latency metrics in apiserver.
func
resetMetrics
(
c
*
client
.
Client
)
error
{
Logf
(
"Resetting latency metrics in apiserver..."
)
body
,
err
:=
c
.
Get
()
.
AbsPath
(
"/resetMetrics"
)
.
DoRaw
()
if
err
!=
nil
{
return
err
}
if
string
(
body
)
!=
"metrics reset
\n
"
{
return
fmt
.
Errorf
(
"Unexpected response: "
,
string
(
body
))
}
return
nil
}
// Retrieve metrics information
// Retrieve metrics information
func
getMetrics
(
c
*
client
.
Client
)
(
string
,
error
)
{
func
getMetrics
(
c
*
client
.
Client
)
(
string
,
error
)
{
body
,
err
:=
c
.
Get
()
.
AbsPath
(
"/metrics"
)
.
DoRaw
()
body
,
err
:=
c
.
Get
()
.
AbsPath
(
"/metrics"
)
.
DoRaw
()
...
...
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