def __report_timings(self): # {{{3
    if self.logger.isEnabledFor(logging.DEBUG):
      timings = [(self.time_spent_traversing_tree, 'Traversing the tree'),
                 (self.time_spent_caching_nodes, 'Caching tree nodes'),
                 (self.time_spent_interning, 'Interning path components'),
                 (self.time_spent_writing_blocks, 'Writing data blocks'),
                 (self.time_spent_hashing, 'Hashing data blocks'),
                 (self.time_spent_querying_tree, 'Querying the tree')]
      maxdescwidth = max([len(l) for t, l in timings]) + 3
      timings.sort(reverse=True)
      uptime = time.time() - self.fs_mounted_at
      printed_heading = False
      for timespan, description in timings:
        percentage = timespan / (uptime / 100)
        if percentage >= 1:
          if not printed_heading:
            self.logger.debug("Cumulative timings of slowest operations:")
            printed_heading = True
          self.logger.debug(" - %-*s%s (%i%%)" % (maxdescwidth, description + ':', format_timespan(timespan), percentage))
dataset/ETHPy150Open xolox/dedupfs/dedupfs.py/DedupFS.__report_timings/original