def add_check_and_repair(self, r, path): if not r: return # non-distributed object, i.e. LIT file r = ICheckAndRepairResults(r) assert isinstance(path, (list, tuple)) pre_repair = r.get_pre_repair_results() post_repair = r.get_post_repair_results() self.objects_checked += 1 if pre_repair.is_healthy(): self.objects_healthy += 1 else: self.objects_unhealthy += 1 if not pre_repair.is_recoverable(): self.objects_unrecoverable += 1 self.corrupt_shares.extend(pre_repair.get_corrupt_shares()) if r.get_repair_attempted(): self.repairs_attempted += 1 if r.get_repair_successful(): self.repairs_successful += 1 else: self.repairs_unsuccessful += 1 if post_repair.is_healthy(): self.objects_healthy_post_repair += 1 else: self.objects_unhealthy_post_repair += 1 if not post_repair.is_recoverable(): self.objects_unrecoverable_post_repair += 1 self.all_results[tuple(path)] = r self.all_results_by_storage_index[r.get_storage_index()] = r self.corrupt_shares_post_repair.extend( post_repair.get_corrupt_shares())
def __init__(self, client, results): """ :param allmydata.interfaces.IStatsProducer client: stats provider. :param allmydata.interfaces.ICheckResults results: check/verify results. """ super(CheckAndRepairResultsRenderer, self).__init__() self._client = client self._results = None if results: self._results = ICheckAndRepairResults(results)
def __init__(self, client, results): self.client = client self.r = None if results: self.r = ICheckAndRepairResults(results) rend.Page.__init__(self, results)