immutable/checker: include a summary (with 'Healthy' or 'Not Healthy' and a count...
authorBrian Warner <warner@allmydata.com>
Fri, 9 Jan 2009 03:01:45 +0000 (20:01 -0700)
committerBrian Warner <warner@allmydata.com>
Fri, 9 Jan 2009 03:01:45 +0000 (20:01 -0700)
src/allmydata/immutable/checker.py

index 6b36a346925695b339ee97bdc670dc363de22aad..653a49daf32827c1e080c4f4fde503fbf94039aa 100644 (file)
@@ -227,8 +227,13 @@ class Checker(log.PrefixingLogMixin):
         assert len(verifiedshares) <= self._verifycap.total_shares, (verifiedshares.keys(), self._verifycap.total_shares)
         if len(verifiedshares) == self._verifycap.total_shares:
             cr.set_healthy(True)
+            cr.set_summary("Healthy")
         else:
             cr.set_healthy(False)
+            cr.set_summary("Not Healthy: %d shares (enc %d-of-%d)" %
+                           (len(verifiedshares),
+                            self._verifycap.needed_shares,
+                            self._verifycap.total_shares))
         if len(verifiedshares) >= self._verifycap.needed_shares:
             cr.set_recoverable(True)
             d['count-recoverable-versions'] = 1