Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snf-ganeti
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
snf-ganeti
Commits
daee4bed
Commit
daee4bed
authored
15 years ago
by
Iustin Pop
Browse files
Options
Downloads
Patches
Plain Diff
Add a few comments in the scoring function
parent
117dc2d8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Ganeti/HTools/Cluster.hs
+7
-0
7 additions, 0 deletions
Ganeti/HTools/Cluster.hs
with
7 additions
and
0 deletions
Ganeti/HTools/Cluster.hs
+
7
−
0
View file @
daee4bed
...
@@ -195,23 +195,30 @@ compDetailedCV nl =
...
@@ -195,23 +195,30 @@ compDetailedCV nl =
(
offline
,
nodes
)
=
partition
Node
.
offline
all_nodes
(
offline
,
nodes
)
=
partition
Node
.
offline
all_nodes
mem_l
=
map
Node
.
pMem
nodes
mem_l
=
map
Node
.
pMem
nodes
dsk_l
=
map
Node
.
pDsk
nodes
dsk_l
=
map
Node
.
pDsk
nodes
-- metric: memory covariance
mem_cv
=
varianceCoeff
mem_l
mem_cv
=
varianceCoeff
mem_l
-- metric: disk covariance
dsk_cv
=
varianceCoeff
dsk_l
dsk_cv
=
varianceCoeff
dsk_l
n1_l
=
length
$
filter
Node
.
failN1
nodes
n1_l
=
length
$
filter
Node
.
failN1
nodes
-- metric: ratio of failN1 nodes
n1_score
=
fromIntegral
n1_l
/
n1_score
=
fromIntegral
n1_l
/
fromIntegral
(
length
nodes
)
::
Double
fromIntegral
(
length
nodes
)
::
Double
res_l
=
map
Node
.
pRem
nodes
res_l
=
map
Node
.
pRem
nodes
-- metric: reserved memory covariance
res_cv
=
varianceCoeff
res_l
res_cv
=
varianceCoeff
res_l
offline_inst
=
sum
.
map
(
\
n
->
(
length
.
Node
.
pList
$
n
)
+
offline_inst
=
sum
.
map
(
\
n
->
(
length
.
Node
.
pList
$
n
)
+
(
length
.
Node
.
sList
$
n
))
$
offline
(
length
.
Node
.
sList
$
n
))
$
offline
online_inst
=
sum
.
map
(
\
n
->
(
length
.
Node
.
pList
$
n
)
+
online_inst
=
sum
.
map
(
\
n
->
(
length
.
Node
.
pList
$
n
)
+
(
length
.
Node
.
sList
$
n
))
$
nodes
(
length
.
Node
.
sList
$
n
))
$
nodes
-- metric: ratio of instances on offline nodes
off_score
=
if
offline_inst
==
0
off_score
=
if
offline_inst
==
0
then
0
::
Double
then
0
::
Double
else
fromIntegral
offline_inst
/
else
fromIntegral
offline_inst
/
fromIntegral
(
offline_inst
+
online_inst
)
::
Double
fromIntegral
(
offline_inst
+
online_inst
)
::
Double
cpu_l
=
map
Node
.
pCpu
nodes
cpu_l
=
map
Node
.
pCpu
nodes
-- metric: covariance of vcpu/pcpu ratio
cpu_cv
=
varianceCoeff
cpu_l
cpu_cv
=
varianceCoeff
cpu_l
-- metrics: covariance of cpu, memory, disk and network load
(
c_load
,
m_load
,
d_load
,
n_load
)
=
unzip4
$
(
c_load
,
m_load
,
d_load
,
n_load
)
=
unzip4
$
map
(
\
n
->
map
(
\
n
->
let
DynUtil
c1
m1
d1
n1
=
Node
.
utilLoad
n
let
DynUtil
c1
m1
d1
n1
=
Node
.
utilLoad
n
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment