def _view_metrics(self, queue_type, queue_id):
        """Gets SharQ metrics based on the params."""
        response = {
            'status': 'failure'
        }
        request_data = {}
        if queue_type:
            request_data['queue_type'] = queue_type
        if queue_id:
            request_data['queue_id'] = queue_id

        try:
            response = self.sq.metrics(**request_data)
        except Exception, e:
            response['message'] = e.message
            return jsonify(**response), 400

        return jsonify(**response)
def _view_metrics ( self , queue_type , queue_id ) : response = { 'status' : 'failure' } request_data = { } if queue_type : request_data [ 'queue_type' ] = queue_type if queue_id : request_data [ 'queue_id' ] = queue_id try : response = self . sq . metrics ( ** request_data ) except Exception , e : response [ 'message' ] = e . message return jsonify ( ** response ) , 400 return jsonify ( ** response )
Gets SharQ metrics based on the params.