This patchset implements the second metric component from the "Improving Location Awareness of Ganeti" design document. The metric is extended by
- The number of pairs of exclusion tags and common-failure tags where there exist at least two instances with the given exclusion tag with the primary node having the given common-failure tag. This is implemented by addition a Map storing the number of instances for each node location and instance exclusion tag to a Node datatype. This map is used as a AggregateComponent in order to collect and calculate statistics for this metric component. To support such metric Statistics Datatype is extended by the MapStatstics constructor. Also The simple Double value which was used for statistic construction and updates replaced by AggregateComponent datatype which may store either SimpleValue or TagTagMap - the new type alias for Map (String. String) Int. Also some dirty hack is used in Statistics.hs in order to avoid non exhaustive pattern matching which should be logically done. In this hack I implement general version of updateStatistics and get* functions in order to avoid warnings and runtime errors. Also the changes in the first patch brokes the Statistic.hs test which is reincarnated in the patch. Oleg Ponomarev (3): Implement common-failure exclusion tags Add test for the common-failure exclusion tags Update hbal man page Makefile.am | 1 + man/hbal.rst | 9 ++-- src/Ganeti/HTools/Cluster/Metrics.hs | 27 ++++++---- src/Ganeti/HTools/Node.hs | 41 +++++++++++---- src/Ganeti/Utils/Statistics.hs | 74 ++++++++++++++++++++++----- test/data/htools/hbal-location-exclusion.data | 12 +++++ test/hs/Test/Ganeti/Utils/Statistics.hs | 6 ++- test/hs/shelltests/htools-hbal.test | 9 ++++ 8 files changed, 141 insertions(+), 38 deletions(-) create mode 100644 test/data/htools/hbal-location-exclusion.data -- 1.9.1
