From 0c860cff908e57fd36cd50ad81fb1e319aa5077c Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Fri, 11 Dec 2009 18:01:10 +0100
Subject: [PATCH] Convert n1_score metric from % to count

This increases the priority of fixing N+1 failures compared to balancing
metrics.
---
 Ganeti/HTools/Cluster.hs | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/Ganeti/HTools/Cluster.hs b/Ganeti/HTools/Cluster.hs
index ad86db49d..e29eb0981 100644
--- a/Ganeti/HTools/Cluster.hs
+++ b/Ganeti/HTools/Cluster.hs
@@ -177,7 +177,7 @@ totalResources nl =
 detailedCVNames :: [String]
 detailedCVNames = [ "free_mem_cv"
                   , "free_disk_cv"
-                  , "n1_score"
+                  , "n1_cnt"
                   , "reserved_mem_cv"
                   , "offline_all_cnt"
                   , "offline_pri_cnt"
@@ -202,9 +202,8 @@ compDetailedCV nl =
         -- metric: disk covariance
         dsk_cv = varianceCoeff dsk_l
         n1_l = length $ filter Node.failN1 nodes
-        -- metric: ratio of failN1 nodes
-        n1_score = fromIntegral n1_l /
-                   fromIntegral (length nodes)::Double
+        -- metric: count of failN1 nodes
+        n1_score = fromIntegral n1_l::Double
         res_l = map Node.pRem nodes
         -- metric: reserved memory covariance
         res_cv = varianceCoeff res_l
-- 
GitLab