From d844fe880a0359763bbe575f64729c09940909b9 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Sun, 15 Nov 2009 00:02:17 +0100 Subject: [PATCH] Use conflicting primaries count in cluster score This small patch adds the number of conflicting primaries in the cluster score. This is different from the other non-CV metrics where we usually compute the percentage of failing instances (for that metric); but for a somewhat big cluster, 1-2% failing instances will be a too small value to cause the relocation of conflicting instances (future patches will also switch other non-CV metrics to this method). --- Ganeti/HTools/Cluster.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Ganeti/HTools/Cluster.hs b/Ganeti/HTools/Cluster.hs index 9a94d0b..ffdb876 100644 --- a/Ganeti/HTools/Cluster.hs +++ b/Ganeti/HTools/Cluster.hs @@ -185,6 +185,7 @@ detailedCVNames = [ "free_mem_cv" , "mem_load_cv" , "disk_load_cv" , "net_load_cv" + , "pri_tags_score" ] -- | Compute the mem and disk covariance. @@ -225,9 +226,13 @@ compDetailedCV nl = DynUtil c2 m2 d2 n2 = Node.utilPool n in (c1/c2, m1/m2, d1/d2, n1/n2) ) nodes + -- metric: conflicting instance count + pri_tags_inst = sum $ map Node.conflictingPrimaries nodes + pri_tags_score = fromIntegral pri_tags_inst::Double in [ mem_cv, dsk_cv, n1_score, res_cv, off_score, cpu_cv , varianceCoeff c_load, varianceCoeff m_load - , varianceCoeff d_load, varianceCoeff n_load] + , varianceCoeff d_load, varianceCoeff n_load + , pri_tags_score ] -- | Compute the /total/ variance. compCV :: Node.List -> Double -- 1.7.10.4