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
b9ae20c9
Commit
b9ae20c9
authored
Jun 21, 2018
by
Shyam Jeedigunta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split scheduler latency metric to fine-grained steps
parent
83ad4d9e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
11 deletions
+25
-11
generic_scheduler.go
pkg/scheduler/core/generic_scheduler.go
+2
-0
metrics.go
pkg/scheduler/metrics/metrics.go
+8
-2
scheduler.go
pkg/scheduler/scheduler.go
+1
-1
metrics_util.go
test/e2e/framework/metrics_util.go
+14
-8
No files found.
pkg/scheduler/core/generic_scheduler.go
View file @
b9ae20c9
...
@@ -142,6 +142,7 @@ func (g *genericScheduler) Schedule(pod *v1.Pod, nodeLister algorithm.NodeLister
...
@@ -142,6 +142,7 @@ func (g *genericScheduler) Schedule(pod *v1.Pod, nodeLister algorithm.NodeLister
}
}
}
}
metrics
.
SchedulingAlgorithmPredicateEvaluationDuration
.
Observe
(
metrics
.
SinceInMicroseconds
(
startPredicateEvalTime
))
metrics
.
SchedulingAlgorithmPredicateEvaluationDuration
.
Observe
(
metrics
.
SinceInMicroseconds
(
startPredicateEvalTime
))
metrics
.
SchedulingLatency
.
WithLabelValues
(
metrics
.
PredicateEvaluation
)
.
Observe
(
metrics
.
SinceInSeconds
(
startPredicateEvalTime
))
trace
.
Step
(
"Prioritizing"
)
trace
.
Step
(
"Prioritizing"
)
startPriorityEvalTime
:=
time
.
Now
()
startPriorityEvalTime
:=
time
.
Now
()
...
@@ -157,6 +158,7 @@ func (g *genericScheduler) Schedule(pod *v1.Pod, nodeLister algorithm.NodeLister
...
@@ -157,6 +158,7 @@ func (g *genericScheduler) Schedule(pod *v1.Pod, nodeLister algorithm.NodeLister
return
""
,
err
return
""
,
err
}
}
metrics
.
SchedulingAlgorithmPriorityEvaluationDuration
.
Observe
(
metrics
.
SinceInMicroseconds
(
startPriorityEvalTime
))
metrics
.
SchedulingAlgorithmPriorityEvaluationDuration
.
Observe
(
metrics
.
SinceInMicroseconds
(
startPriorityEvalTime
))
metrics
.
SchedulingLatency
.
WithLabelValues
(
metrics
.
PriorityEvaluation
)
.
Observe
(
metrics
.
SinceInSeconds
(
startPriorityEvalTime
))
trace
.
Step
(
"Selecting host"
)
trace
.
Step
(
"Selecting host"
)
return
g
.
selectHost
(
priorityList
)
return
g
.
selectHost
(
priorityList
)
...
...
pkg/scheduler/metrics/metrics.go
View file @
b9ae20c9
...
@@ -31,10 +31,16 @@ const (
...
@@ -31,10 +31,16 @@ const (
// OperationLabel - operation label name
// OperationLabel - operation label name
OperationLabel
=
"operation"
OperationLabel
=
"operation"
// Below are possible values for the operation label. Each represents a substep of e2e scheduling:
// PredicateEvaluation - predicate evaluation operation label value
PredicateEvaluation
=
"predicate_evaluation"
// PriorityEvaluation - priority evaluation operation label value
PriorityEvaluation
=
"priority_evaluation"
// PreemptionEvaluation - preemption evaluation operation label value (occurs in case of scheduling fitError).
PreemptionEvaluation
=
"preemption_evaluation"
// Binding - binding operation label value
// Binding - binding operation label value
Binding
=
"binding"
Binding
=
"binding"
// SelectingNode - selecting node operation label value
SelectingNode
=
"selecting_node"
// E2eScheduling - e2e scheduling operation label value
// E2eScheduling - e2e scheduling operation label value
)
)
...
...
pkg/scheduler/scheduler.go
View file @
b9ae20c9
...
@@ -460,11 +460,11 @@ func (sched *Scheduler) scheduleOne() {
...
@@ -460,11 +460,11 @@ func (sched *Scheduler) scheduleOne() {
sched
.
preempt
(
pod
,
fitError
)
sched
.
preempt
(
pod
,
fitError
)
metrics
.
PreemptionAttempts
.
Inc
()
metrics
.
PreemptionAttempts
.
Inc
()
metrics
.
SchedulingAlgorithmPremptionEvaluationDuration
.
Observe
(
metrics
.
SinceInMicroseconds
(
preemptionStartTime
))
metrics
.
SchedulingAlgorithmPremptionEvaluationDuration
.
Observe
(
metrics
.
SinceInMicroseconds
(
preemptionStartTime
))
metrics
.
SchedulingLatency
.
WithLabelValues
(
metrics
.
PreemptionEvaluation
)
.
Observe
(
metrics
.
SinceInSeconds
(
preemptionStartTime
))
}
}
return
return
}
}
metrics
.
SchedulingAlgorithmLatency
.
Observe
(
metrics
.
SinceInMicroseconds
(
start
))
metrics
.
SchedulingAlgorithmLatency
.
Observe
(
metrics
.
SinceInMicroseconds
(
start
))
metrics
.
SchedulingLatency
.
WithLabelValues
(
metrics
.
SelectingNode
)
.
Observe
(
metrics
.
SinceInSeconds
(
start
))
// Tell the cache to assume that a pod now is running on a given node, even though it hasn't been bound yet.
// Tell the cache to assume that a pod now is running on a given node, even though it hasn't been bound yet.
// This allows us to keep scheduling without waiting on binding to occur.
// This allows us to keep scheduling without waiting on binding to occur.
assumedPod
:=
pod
.
DeepCopy
()
assumedPod
:=
pod
.
DeepCopy
()
...
...
test/e2e/framework/metrics_util.go
View file @
b9ae20c9
...
@@ -210,12 +210,14 @@ func (l *PodStartupLatency) PrintJSON() string {
...
@@ -210,12 +210,14 @@ func (l *PodStartupLatency) PrintJSON() string {
}
}
type
SchedulingMetrics
struct
{
type
SchedulingMetrics
struct
{
SelectingNodeLatency
LatencyMetric
`json:"selectingNodeLatency"`
PredicateEvaluationLatency
LatencyMetric
`json:"predicateEvaluationLatency"`
BindingLatency
LatencyMetric
`json:"bindingLatency"`
PriorityEvaluationLatency
LatencyMetric
`json:"priorityEvaluationLatency"`
ThroughputAverage
float64
`json:"throughputAverage"`
PreemptionEvaluationLatency
LatencyMetric
`json:"preemptionEvaluationLatency"`
ThroughputPerc50
float64
`json:"throughputPerc50"`
BindingLatency
LatencyMetric
`json:"bindingLatency"`
ThroughputPerc90
float64
`json:"throughputPerc90"`
ThroughputAverage
float64
`json:"throughputAverage"`
ThroughputPerc99
float64
`json:"throughputPerc99"`
ThroughputPerc50
float64
`json:"throughputPerc50"`
ThroughputPerc90
float64
`json:"throughputPerc90"`
ThroughputPerc99
float64
`json:"throughputPerc99"`
}
}
func
(
l
*
SchedulingMetrics
)
SummaryKind
()
string
{
func
(
l
*
SchedulingMetrics
)
SummaryKind
()
string
{
...
@@ -511,8 +513,12 @@ func getSchedulingLatency(c clientset.Interface) (*SchedulingMetrics, error) {
...
@@ -511,8 +513,12 @@ func getSchedulingLatency(c clientset.Interface) (*SchedulingMetrics, error) {
var
metric
*
LatencyMetric
=
nil
var
metric
*
LatencyMetric
=
nil
switch
sample
.
Metric
[
schedulermetric
.
OperationLabel
]
{
switch
sample
.
Metric
[
schedulermetric
.
OperationLabel
]
{
case
schedulermetric
.
SelectingNode
:
case
schedulermetric
.
PredicateEvaluation
:
metric
=
&
result
.
SelectingNodeLatency
metric
=
&
result
.
PredicateEvaluationLatency
case
schedulermetric
.
PriorityEvaluation
:
metric
=
&
result
.
PriorityEvaluationLatency
case
schedulermetric
.
PreemptionEvaluation
:
metric
=
&
result
.
PreemptionEvaluationLatency
case
schedulermetric
.
Binding
:
case
schedulermetric
.
Binding
:
metric
=
&
result
.
BindingLatency
metric
=
&
result
.
BindingLatency
}
}
...
...
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