Skip to content
Snippets Groups Projects
Commit daee4bed authored by Iustin Pop's avatar Iustin Pop
Browse files

Add a few comments in the scoring function

parent 117dc2d8
No related branches found
No related tags found
No related merge requests found
...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment