def RequestsFailedCriteria(request_rate, failed_rate):
 alerts = []
 warnings = []
 def _ComputeThreshold(x):
  return math.ceil(math.sqrt(x))
 if (failed_rate['cluster_total'] > _ComputeThreshold(request_rate['cluster_total'])):
  warnings.append(CLUSTER_TOKEN)
 for (m, v) in request_rate['machine_data'].iteritems():
  if (failed_rate['machine_data'][m] > _ComputeThreshold(v)):
   warnings.append(m)
 return (alerts, warnings)

def RequestsFailedCriteria ( request_rate , failed_rate ) : alerts = [ ] warnings = [ ] def _ComputeThreshold ( x ) : return math . ceil ( math . sqrt ( x ) ) if ( failed_rate [ 'cluster_total' ] > _ComputeThreshold ( request_rate [ 'cluster_total' ] ) ) : warnings . append ( CLUSTER_TOKEN ) for ( m , v ) in request_rate [ 'machine_data' ] . iteritems ( ) : if ( failed_rate [ 'machine_data' ] [ m ] > _ComputeThreshold ( v ) ) : warnings . append ( m ) return ( alerts , warnings )
monitor the rate of failed service requests on the server .