code: def error_rate(self):
          
          if not self.stat['requests']:
              return 0
          return round(
              sum(self.stat['errors'].values()) / self.stat['requests'], 2
          )
docs: Error rate: from 0 to 1.
  
          For example: 0.7 = 70% requests ends with error.
  
          :rtype: float
  
          .. versionadded:: 0.2.0