Commit e4d31268 authored by Iustin Pop's avatar Iustin Pop
Browse files

Offline instance metric: change from % to count

Currently we use the offline instance percentage (with range [0, 1]),
but this is not good, since we want the evacuation of such instances to
have a high priority; therefore we change this to a count of offline
instances, which has higher weight than a metric with range [0, 1].
parent 31728b11
......@@ -179,7 +179,7 @@ detailedCVNames = [ "free_mem_cv"
, "free_disk_cv"
, "n1_score"
, "reserved_mem_cv"
, "offline_score"
, "offline_all_cnt"
, "vcpu_ratio_cv"
, "cpu_load_cv"
, "mem_load_cv"
......@@ -207,15 +207,11 @@ compDetailedCV nl =
res_l = map Node.pRem nodes
-- metric: reserved memory covariance
res_cv = varianceCoeff res_l
offline_inst = sum . map (\n -> (length . Node.pList $ n) +
(length . Node.sList $ n)) $ offline
online_inst = sum . map (\n -> (length . Node.pList $ n) +
(length . Node.sList $ n)) $ nodes
-- metric: ratio of instances on offline nodes
off_score = if offline_inst == 0
then 0::Double
else fromIntegral offline_inst /
fromIntegral (offline_inst + online_inst)::Double
-- offline instances metrics
offline_ipri = sum . map (length . Node.pList) $ offline
offline_isec = sum . map (length . Node.sList) $ offline
-- metric: count of instances on offline nodes
off_score = fromIntegral (offline_ipri + offline_isec)::Double
cpu_l = map Node.pCpu nodes
-- metric: covariance of vcpu/pcpu ratio
cpu_cv = varianceCoeff cpu_l
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment