#NEWLINE# def weight_locations( self , locations , load , available_locations ) : #NEWLINE# #INDENT# total = float ( sum ( locations . values ( ) ) ) #NEWLINE# for ( loc_name , share ) in iteritems ( locations ) : #NEWLINE# #INDENT# loc_info = available_locations [ loc_name ] #NEWLINE# limits = loc_info [ 'limits' ] #NEWLINE# if ( load . duration > ( limits [ 'duration' ] * 60 ) ) : #NEWLINE# #INDENT# msg = 'Test duration %s exceeds limit %s for location %s' #NEWLINE# self . log . warning ( locations , load . duration , ( limits [ 'duration' ] * 60 ) , loc_name ) #NEWLINE# #UNINDENT# if load . concurrency : #NEWLINE# #INDENT# locations [ loc_name ] = int ( math . ceil ( ( ( ( load . concurrency * share ) / total ) / limits [ 'threadsPerEngine' ] ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# locations [ loc_name ] = 1