#NEWLINE# def prepare( self ) : #NEWLINE# #INDENT# self . scenario = self . get_scenario ( ) #NEWLINE# self . tool_path = self . _check_installed ( ) #NEWLINE# config_params = ( 'verbose = true' , 'csv = true' , 'timestamp = false' , 'fullurl = true' , 'display-id = true' , 'show-logfile = false' , 'logging = false' ) #NEWLINE# self . __rc_name = self . engine . create_artifact ( 'siegerc' , '' ) #NEWLINE# with open ( self . __rc_name , 'w' ) as rc_file : #NEWLINE# #INDENT# rc_file . writelines ( '\n' . join ( config_params ) ) #NEWLINE# rc_file . close ( ) #NEWLINE# #UNINDENT# if ( Scenario . SCRIPT in self . scenario ) : #NEWLINE# #INDENT# self . __url_name = self . engine . find_file ( self . scenario [ Scenario . SCRIPT ] ) #NEWLINE# self . engine . existing_artifact ( self . __url_name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'requests' in self . scenario ) : #NEWLINE# #INDENT# self . __url_name = self . _fill_url_file ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'You must specify either script(url-file) or some requests for siege' ) #NEWLINE# #UNINDENT# #UNINDENT# out_file_name = self . engine . create_artifact ( 'siege' , '.out' ) #NEWLINE# self . reader = DataLogReader ( out_file_name , self . log ) #NEWLINE# if isinstance ( self . engine . aggregator , ConsolidatingAggregator ) : #NEWLINE# #INDENT# self . engine . aggregator . add_underling ( self . reader ) #NEWLINE# #UNINDENT# self . __out = open ( out_file_name , 'w' ) #NEWLINE# self . __err = open ( self . engine . create_artifact ( 'siege' , '.err' ) , 'w' )