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
184eb831
Commit
184eb831
authored
Nov 26, 2017
by
Cao Shufeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove extra level check of glog
parent
0a3cf593
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
15 deletions
+5
-15
balanced_resource_allocation.go
...uler/algorithm/priorities/balanced_resource_allocation.go
+1
-3
interpod_affinity.go
...n/pkg/scheduler/algorithm/priorities/interpod_affinity.go
+1
-3
least_requested.go
plugin/pkg/scheduler/algorithm/priorities/least_requested.go
+1
-3
most_requested.go
plugin/pkg/scheduler/algorithm/priorities/most_requested.go
+1
-3
selector_spreading.go
.../pkg/scheduler/algorithm/priorities/selector_spreading.go
+1
-3
No files found.
plugin/pkg/scheduler/algorithm/priorities/balanced_resource_allocation.go
View file @
184eb831
...
@@ -74,9 +74,7 @@ func calculateBalancedResourceAllocation(pod *v1.Pod, podRequests *schedulercach
...
@@ -74,9 +74,7 @@ func calculateBalancedResourceAllocation(pod *v1.Pod, podRequests *schedulercach
score
=
int
((
1
-
diff
)
*
float64
(
schedulerapi
.
MaxPriority
))
score
=
int
((
1
-
diff
)
*
float64
(
schedulerapi
.
MaxPriority
))
}
}
if
glog
.
V
(
10
)
{
if
glog
.
V
(
10
)
{
// We explicitly don't do glog.V(10).Infof() to avoid computing all the parameters if this is
glog
.
Infof
(
// not logged. There is visible performance gain from it.
glog
.
V
(
10
)
.
Infof
(
"%v -> %v: Balanced Resource Allocation, capacity %d millicores %d memory bytes, total request %d millicores %d memory bytes, score %d"
,
"%v -> %v: Balanced Resource Allocation, capacity %d millicores %d memory bytes, total request %d millicores %d memory bytes, score %d"
,
pod
.
Name
,
node
.
Name
,
pod
.
Name
,
node
.
Name
,
allocatableResources
.
MilliCPU
,
allocatableResources
.
Memory
,
allocatableResources
.
MilliCPU
,
allocatableResources
.
Memory
,
...
...
plugin/pkg/scheduler/algorithm/priorities/interpod_affinity.go
View file @
184eb831
...
@@ -229,9 +229,7 @@ func (ipa *InterPodAffinity) CalculateInterPodAffinityPriority(pod *v1.Pod, node
...
@@ -229,9 +229,7 @@ func (ipa *InterPodAffinity) CalculateInterPodAffinityPriority(pod *v1.Pod, node
}
}
result
=
append
(
result
,
schedulerapi
.
HostPriority
{
Host
:
node
.
Name
,
Score
:
int
(
fScore
)})
result
=
append
(
result
,
schedulerapi
.
HostPriority
{
Host
:
node
.
Name
,
Score
:
int
(
fScore
)})
if
glog
.
V
(
10
)
{
if
glog
.
V
(
10
)
{
// We explicitly don't do glog.V(10).Infof() to avoid computing all the parameters if this is
glog
.
Infof
(
"%v -> %v: InterPodAffinityPriority, Score: (%d)"
,
pod
.
Name
,
node
.
Name
,
int
(
fScore
))
// not logged. There is visible performance gain from it.
glog
.
V
(
10
)
.
Infof
(
"%v -> %v: InterPodAffinityPriority, Score: (%d)"
,
pod
.
Name
,
node
.
Name
,
int
(
fScore
))
}
}
}
}
return
result
,
nil
return
result
,
nil
...
...
plugin/pkg/scheduler/algorithm/priorities/least_requested.go
View file @
184eb831
...
@@ -73,9 +73,7 @@ func calculateUnusedPriority(pod *v1.Pod, podRequests *schedulercache.Resource,
...
@@ -73,9 +73,7 @@ func calculateUnusedPriority(pod *v1.Pod, podRequests *schedulercache.Resource,
cpuScore
:=
calculateUnusedScore
(
totalResources
.
MilliCPU
,
allocatableResources
.
MilliCPU
,
node
.
Name
)
cpuScore
:=
calculateUnusedScore
(
totalResources
.
MilliCPU
,
allocatableResources
.
MilliCPU
,
node
.
Name
)
memoryScore
:=
calculateUnusedScore
(
totalResources
.
Memory
,
allocatableResources
.
Memory
,
node
.
Name
)
memoryScore
:=
calculateUnusedScore
(
totalResources
.
Memory
,
allocatableResources
.
Memory
,
node
.
Name
)
if
glog
.
V
(
10
)
{
if
glog
.
V
(
10
)
{
// We explicitly don't do glog.V(10).Infof() to avoid computing all the parameters if this is
glog
.
Infof
(
// not logged. There is visible performance gain from it.
glog
.
V
(
10
)
.
Infof
(
"%v -> %v: Least Requested Priority, capacity %d millicores %d memory bytes, total request %d millicores %d memory bytes, score %d CPU %d memory"
,
"%v -> %v: Least Requested Priority, capacity %d millicores %d memory bytes, total request %d millicores %d memory bytes, score %d CPU %d memory"
,
pod
.
Name
,
node
.
Name
,
pod
.
Name
,
node
.
Name
,
allocatableResources
.
MilliCPU
,
allocatableResources
.
Memory
,
allocatableResources
.
MilliCPU
,
allocatableResources
.
Memory
,
...
...
plugin/pkg/scheduler/algorithm/priorities/most_requested.go
View file @
184eb831
...
@@ -76,9 +76,7 @@ func calculateUsedPriority(pod *v1.Pod, podRequests *schedulercache.Resource, no
...
@@ -76,9 +76,7 @@ func calculateUsedPriority(pod *v1.Pod, podRequests *schedulercache.Resource, no
cpuScore
:=
calculateUsedScore
(
totalResources
.
MilliCPU
,
allocatableResources
.
MilliCPU
,
node
.
Name
)
cpuScore
:=
calculateUsedScore
(
totalResources
.
MilliCPU
,
allocatableResources
.
MilliCPU
,
node
.
Name
)
memoryScore
:=
calculateUsedScore
(
totalResources
.
Memory
,
allocatableResources
.
Memory
,
node
.
Name
)
memoryScore
:=
calculateUsedScore
(
totalResources
.
Memory
,
allocatableResources
.
Memory
,
node
.
Name
)
if
glog
.
V
(
10
)
{
if
glog
.
V
(
10
)
{
// We explicitly don't do glog.V(10).Infof() to avoid computing all the parameters if this is
glog
.
Infof
(
// not logged. There is visible performance gain from it.
glog
.
V
(
10
)
.
Infof
(
"%v -> %v: Most Requested Priority, capacity %d millicores %d memory bytes, total request %d millicores %d memory bytes, score %d CPU %d memory"
,
"%v -> %v: Most Requested Priority, capacity %d millicores %d memory bytes, total request %d millicores %d memory bytes, score %d CPU %d memory"
,
pod
.
Name
,
node
.
Name
,
pod
.
Name
,
node
.
Name
,
allocatableResources
.
MilliCPU
,
allocatableResources
.
Memory
,
allocatableResources
.
MilliCPU
,
allocatableResources
.
Memory
,
...
...
plugin/pkg/scheduler/algorithm/priorities/selector_spreading.go
View file @
184eb831
...
@@ -163,9 +163,7 @@ func (s *SelectorSpread) CalculateSpreadPriorityReduce(pod *v1.Pod, meta interfa
...
@@ -163,9 +163,7 @@ func (s *SelectorSpread) CalculateSpreadPriorityReduce(pod *v1.Pod, meta interfa
}
}
result
[
i
]
.
Score
=
int
(
fScore
)
result
[
i
]
.
Score
=
int
(
fScore
)
if
glog
.
V
(
10
)
{
if
glog
.
V
(
10
)
{
// We explicitly don't do glog.V(10).Infof() to avoid computing all the parameters if this is
glog
.
Infof
(
// not logged. There is visible performance gain from it.
glog
.
V
(
10
)
.
Infof
(
"%v -> %v: SelectorSpreadPriority, Score: (%d)"
,
pod
.
Name
,
result
[
i
]
.
Host
,
int
(
fScore
),
"%v -> %v: SelectorSpreadPriority, Score: (%d)"
,
pod
.
Name
,
result
[
i
]
.
Host
,
int
(
fScore
),
)
)
}
}
...
...
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