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
b0dd166f
Commit
b0dd166f
authored
Mar 21, 2018
by
Shyam Jeedigunta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Capture different parts of pod-startup latency as metrics
parent
622ad356
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
28 deletions
+47
-28
metrics_util.go
test/e2e/framework/metrics_util.go
+12
-8
perf_util.go
test/e2e/framework/perf_util.go
+17
-10
density.go
test/e2e/scalability/density.go
+15
-7
density_test.go
test/e2e_node/density_test.go
+3
-3
No files found.
test/e2e/framework/metrics_util.go
View file @
b0dd166f
...
@@ -188,7 +188,11 @@ type LatencyMetric struct {
...
@@ -188,7 +188,11 @@ type LatencyMetric struct {
}
}
type
PodStartupLatency
struct
{
type
PodStartupLatency
struct
{
Latency
LatencyMetric
`json:"latency"`
CreateToScheduleLatency
LatencyMetric
`json:"createToScheduleLatency"`
ScheduleToRunLatency
LatencyMetric
`json:"scheduleToRunLatency"`
RunToWatchLatency
LatencyMetric
`json:"runToWatchLatency"`
ScheduleToWatchLatency
LatencyMetric
`json:"scheduleToWatchLatency"`
E2ELatency
LatencyMetric
`json:"e2eLatency"`
}
}
func
(
l
*
PodStartupLatency
)
SummaryKind
()
string
{
func
(
l
*
PodStartupLatency
)
SummaryKind
()
string
{
...
@@ -398,17 +402,17 @@ func HighLatencyRequests(c clientset.Interface, nodeCount int) (int, *APIRespons
...
@@ -398,17 +402,17 @@ func HighLatencyRequests(c clientset.Interface, nodeCount int) (int, *APIRespons
return
badMetrics
,
metrics
,
nil
return
badMetrics
,
metrics
,
nil
}
}
// Verifies whether 50, 90 and 99th percentiles of PodStartupLatency are
// Verifies whether 50, 90 and 99th percentiles of
e2e
PodStartupLatency are
// within the threshold.
// within the threshold.
func
VerifyPodStartupLatency
(
latency
*
PodStartupLatency
)
error
{
func
VerifyPodStartupLatency
(
latency
*
PodStartupLatency
)
error
{
if
latency
.
Latency
.
Perc50
>
podStartupThreshold
{
if
latency
.
E2E
Latency
.
Perc50
>
podStartupThreshold
{
return
fmt
.
Errorf
(
"too high pod startup latency 50th percentile: %v"
,
latency
.
Latency
.
Perc50
)
return
fmt
.
Errorf
(
"too high pod startup latency 50th percentile: %v"
,
latency
.
E2E
Latency
.
Perc50
)
}
}
if
latency
.
Latency
.
Perc90
>
podStartupThreshold
{
if
latency
.
E2E
Latency
.
Perc90
>
podStartupThreshold
{
return
fmt
.
Errorf
(
"too high pod startup latency 90th percentile: %v"
,
latency
.
Latency
.
Perc90
)
return
fmt
.
Errorf
(
"too high pod startup latency 90th percentile: %v"
,
latency
.
E2E
Latency
.
Perc90
)
}
}
if
latency
.
Latency
.
Perc99
>
podStartupThreshold
{
if
latency
.
E2E
Latency
.
Perc99
>
podStartupThreshold
{
return
fmt
.
Errorf
(
"too high pod startup latency 99th percentile: %v"
,
latency
.
Latency
.
Perc99
)
return
fmt
.
Errorf
(
"too high pod startup latency 99th percentile: %v"
,
latency
.
E2E
Latency
.
Perc99
)
}
}
return
nil
return
nil
}
}
...
...
test/e2e/framework/perf_util.go
View file @
b0dd166f
...
@@ -53,22 +53,29 @@ func ApiCallToPerfData(apicalls *APIResponsiveness) *perftype.PerfData {
...
@@ -53,22 +53,29 @@ func ApiCallToPerfData(apicalls *APIResponsiveness) *perftype.PerfData {
return
perfData
return
perfData
}
}
// PodStartupLatencyToPerfData transforms PodStartupLatency to PerfData.
func
latencyToPerfData
(
l
LatencyMetric
,
name
string
)
perftype
.
DataItem
{
func
PodStartupLatencyToPerfData
(
latency
*
PodStartupLatency
)
*
perftype
.
PerfData
{
return
perftype
.
DataItem
{
perfData
:=
&
perftype
.
PerfData
{
Version
:
currentApiCallMetricsVersion
}
item
:=
perftype
.
DataItem
{
Data
:
map
[
string
]
float64
{
Data
:
map
[
string
]
float64
{
"Perc50"
:
float64
(
l
atency
.
Latency
.
Perc50
)
/
1000000
,
// us -> ms
"Perc50"
:
float64
(
l
.
Perc50
)
/
1000000
,
// us -> ms
"Perc90"
:
float64
(
l
atency
.
Latency
.
Perc90
)
/
1000000
,
"Perc90"
:
float64
(
l
.
Perc90
)
/
1000000
,
"Perc99"
:
float64
(
l
atency
.
Latency
.
Perc99
)
/
1000000
,
"Perc99"
:
float64
(
l
.
Perc99
)
/
1000000
,
"Perc100"
:
float64
(
l
atency
.
Latency
.
Perc100
)
/
1000000
,
"Perc100"
:
float64
(
l
.
Perc100
)
/
1000000
,
},
},
Unit
:
"ms"
,
Unit
:
"ms"
,
Labels
:
map
[
string
]
string
{
Labels
:
map
[
string
]
string
{
"Metric"
:
"pod_startup"
,
"Metric"
:
name
,
},
},
}
}
perfData
.
DataItems
=
append
(
perfData
.
DataItems
,
item
)
}
// PodStartupLatencyToPerfData transforms PodStartupLatency to PerfData.
func
PodStartupLatencyToPerfData
(
latency
*
PodStartupLatency
)
*
perftype
.
PerfData
{
perfData
:=
&
perftype
.
PerfData
{
Version
:
currentApiCallMetricsVersion
}
perfData
.
DataItems
=
append
(
perfData
.
DataItems
,
latencyToPerfData
(
latency
.
CreateToScheduleLatency
,
"create_to_schedule"
))
perfData
.
DataItems
=
append
(
perfData
.
DataItems
,
latencyToPerfData
(
latency
.
ScheduleToRunLatency
,
"schedule_to_run"
))
perfData
.
DataItems
=
append
(
perfData
.
DataItems
,
latencyToPerfData
(
latency
.
RunToWatchLatency
,
"run_to_watch"
))
perfData
.
DataItems
=
append
(
perfData
.
DataItems
,
latencyToPerfData
(
latency
.
ScheduleToWatchLatency
,
"schedule_to_watch"
))
perfData
.
DataItems
=
append
(
perfData
.
DataItems
,
latencyToPerfData
(
latency
.
E2ELatency
,
"pod_startup"
))
return
perfData
return
perfData
}
}
...
...
test/e2e/scalability/density.go
View file @
b0dd166f
...
@@ -829,15 +829,23 @@ var _ = SIGDescribe("Density", func() {
...
@@ -829,15 +829,23 @@ var _ = SIGDescribe("Density", func() {
sort
.
Sort
(
framework
.
LatencySlice
(
schedToWatchLag
))
sort
.
Sort
(
framework
.
LatencySlice
(
schedToWatchLag
))
sort
.
Sort
(
framework
.
LatencySlice
(
e2eLag
))
sort
.
Sort
(
framework
.
LatencySlice
(
e2eLag
))
framework
.
PrintLatencies
(
scheduleLag
,
"worst schedule latencies"
)
framework
.
PrintLatencies
(
scheduleLag
,
"worst create-to-schedule latencies"
)
framework
.
PrintLatencies
(
startupLag
,
"worst run-after-schedule latencies"
)
framework
.
PrintLatencies
(
startupLag
,
"worst schedule-to-run latencies"
)
framework
.
PrintLatencies
(
watchLag
,
"worst watch latencies"
)
framework
.
PrintLatencies
(
watchLag
,
"worst run-to-watch latencies"
)
framework
.
PrintLatencies
(
schedToWatchLag
,
"worst scheduled-to-end total latencies"
)
framework
.
PrintLatencies
(
schedToWatchLag
,
"worst schedule-to-watch latencies"
)
framework
.
PrintLatencies
(
e2eLag
,
"worst e2e total latencies"
)
framework
.
PrintLatencies
(
e2eLag
,
"worst e2e latencies"
)
// Capture latency metrics related to pod-startup.
podStartupLatency
:=
&
framework
.
PodStartupLatency
{
CreateToScheduleLatency
:
framework
.
ExtractLatencyMetrics
(
scheduleLag
),
ScheduleToRunLatency
:
framework
.
ExtractLatencyMetrics
(
startupLag
),
RunToWatchLatency
:
framework
.
ExtractLatencyMetrics
(
watchLag
),
ScheduleToWatchLatency
:
framework
.
ExtractLatencyMetrics
(
schedToWatchLag
),
E2ELatency
:
framework
.
ExtractLatencyMetrics
(
e2eLag
),
}
f
.
TestSummaries
=
append
(
f
.
TestSummaries
,
podStartupLatency
)
// Test whether e2e pod startup time is acceptable.
// Test whether e2e pod startup time is acceptable.
podStartupLatency
:=
&
framework
.
PodStartupLatency
{
Latency
:
framework
.
ExtractLatencyMetrics
(
e2eLag
)}
f
.
TestSummaries
=
append
(
f
.
TestSummaries
,
podStartupLatency
)
framework
.
ExpectNoError
(
framework
.
VerifyPodStartupLatency
(
podStartupLatency
))
framework
.
ExpectNoError
(
framework
.
VerifyPodStartupLatency
(
podStartupLatency
))
framework
.
LogSuspiciousLatency
(
startupLag
,
e2eLag
,
nodeCount
,
c
)
framework
.
LogSuspiciousLatency
(
startupLag
,
e2eLag
,
nodeCount
,
c
)
...
...
test/e2e_node/density_test.go
View file @
b0dd166f
...
@@ -556,14 +556,14 @@ func logAndVerifyLatency(batchLag time.Duration, e2eLags []framework.PodLatencyD
...
@@ -556,14 +556,14 @@ func logAndVerifyLatency(batchLag time.Duration, e2eLags []framework.PodLatencyD
latencyMetrics
,
_
:=
getPodStartLatency
(
kubeletAddr
)
latencyMetrics
,
_
:=
getPodStartLatency
(
kubeletAddr
)
framework
.
Logf
(
"Kubelet Prometheus metrics (not reset):
\n
%s"
,
framework
.
PrettyPrintJSON
(
latencyMetrics
))
framework
.
Logf
(
"Kubelet Prometheus metrics (not reset):
\n
%s"
,
framework
.
PrettyPrintJSON
(
latencyMetrics
))
pod
CreateLatency
:=
framework
.
PodStartupLatency
{
Latency
:
framework
.
ExtractLatencyMetrics
(
e2eLags
)}
pod
StartupLatency
:=
framework
.
ExtractLatencyMetrics
(
e2eLags
)
// log latency perf data
// log latency perf data
logPerfData
(
getLatencyPerfData
(
pod
CreateLatency
.
Latency
,
testInfo
),
"latency"
)
logPerfData
(
getLatencyPerfData
(
pod
Startup
Latency
,
testInfo
),
"latency"
)
if
isVerify
{
if
isVerify
{
// check whether e2e pod startup time is acceptable.
// check whether e2e pod startup time is acceptable.
framework
.
ExpectNoError
(
verifyPodStartupLatency
(
podStartupLimits
,
pod
CreateLatency
.
Latency
))
framework
.
ExpectNoError
(
verifyPodStartupLatency
(
podStartupLimits
,
pod
Startup
Latency
))
// check bactch pod creation latency
// check bactch pod creation latency
if
podBatchStartupLimit
>
0
{
if
podBatchStartupLimit
>
0
{
...
...
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