> consider using more expressive variables names. It takes quite some time to
> guess what 'bidx', 'nl', 'ini_cv', 'ini_tbl' are supposed to mean.

I suggest adding the following interdiff

commit 55dad8ca4834331272f20258976308221d82bc7f
Author: Klaus Aehlig <[email protected]>
Date:   Tue Oct 13 14:47:32 2015 +0200

    Interdiff [PATCH master 2/4] Add a function estimating the redundancy of a 
group

diff --git a/src/Ganeti/HTools/RedundancyLevel.hs 
b/src/Ganeti/HTools/RedundancyLevel.hs
index efd6a26..ca77a10 100644
--- a/src/Ganeti/HTools/RedundancyLevel.hs
+++ b/src/Ganeti/HTools/RedundancyLevel.hs
@@ -65,12 +65,12 @@ redundancy opts nl il =
         $ IntMap.toAscList nl
    in case sortedNodes of
      [] -> 0
-     (bidx, bNode):_ ->
-       let bNode' = bNode { Node.offline = True }
-           nl' = Container.add bidx bNode' nl
-           ini_cv = Metrics.compCV nl'
-           ini_tbl = Cluster.Table nl' il ini_cv []
+     (indexBigNode, bigNode):_ ->
+       let bigNode' = bigNode { Node.offline = True }
+           nl' = Container.add indexBigNode bigNode' nl
+           initialMetrics = Metrics.compCV nl'
+           initialTable = Cluster.Table nl' il initialMetrics []
            Cluster.Table nl'' il' _ _ =
-             runListHead ini_tbl id . reverse
-             $ iterateJust (Cluster.tryBalance opts) ini_tbl
+             runListHead initialTable id . reverse
+             $ iterateJust (Cluster.tryBalance opts) initialTable
        in 1 + redundancy opts nl'' il'


-- 
Klaus Aehlig
Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschaeftsfuehrer: Matthew Scott Sucherman, Paul Terence Manicle

Reply via email to