Revision b4bae394
b/htools/Ganeti/HTools/Cluster.hs | ||
---|---|---|
603 | 603 |
-- | Build failure stats out of a list of failures. |
604 | 604 |
collapseFailures :: [FailMode] -> FailStats |
605 | 605 |
collapseFailures flst = |
606 |
map (\k -> (k, length $ filter (k ==) flst)) [minBound..maxBound] |
|
606 |
map (\k -> (k, foldl' (\a e -> if e == k then a + 1 else a) 0 flst)) |
|
607 |
[minBound..maxBound] |
|
607 | 608 |
|
608 | 609 |
-- | Update current Allocation solution and failure stats with new |
609 | 610 |
-- elements. |
Also available in: Unified diff