def OperationRetriesCriteria(operation_rate, retry_rate):
 alerts = []
 warnings = []
 def _ComputeThreshold(x):
  return (math.ceil(math.sqrt(x)) / 3)
 if (retry_rate['cluster_total'] > _ComputeThreshold(operation_rate['cluster_total'])):
  warnings.append(CLUSTER_TOKEN)
 for (m, v) in operation_rate['machine_data'].iteritems():
  if (retry_rate['machine_data'][m] > _ComputeThreshold(v)):
   warnings.append(m)
 return (alerts, warnings)

def OperationRetriesCriteria ( operation_rate , retry_rate ) : alerts = [ ] warnings = [ ] def _ComputeThreshold ( x ) : return ( math . ceil ( math . sqrt ( x ) ) / 3 ) if ( retry_rate [ 'cluster_total' ] > _ComputeThreshold ( operation_rate [ 'cluster_total' ] ) ) : warnings . append ( CLUSTER_TOKEN ) for ( m , v ) in operation_rate [ 'machine_data' ] . iteritems ( ) : if ( retry_rate [ 'machine_data' ] [ m ] > _ComputeThreshold ( v ) ) : warnings . append ( m ) return ( alerts , warnings )
monitor the rate of operation retries on the server .