Fix score calculation to work with empty clusters
authorIustin Pop <iustin@google.com>
Tue, 7 Jul 2009 08:01:30 +0000 (10:01 +0200)
committerIustin Pop <iustin@google.com>
Tue, 7 Jul 2009 08:06:58 +0000 (10:06 +0200)
commit16103319408f07713c229ee6093c959046d447ca
tree7a643de4eb9e0ad6d8934506b439c277570c292a
parentdca7f396cb33835c8b48aa580c3515d61d6e1c2e
Fix score calculation to work with empty clusters

Currently the cluster score calculation includes an offline instance
percentage, expressed as “offline inst / (offline + online inst)”, which
results in NaN for empty clusters. This patch changes the calculation
such that clusters with no offline instances (this criteria includes
completely empty clusters) get a score of zero on this component of the
total score.
Ganeti/HTools/Cluster.hs