Browse Source

Log the time needed to start the network

Steven Engler 3 years ago
parent
commit
40c046e089
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/experiment.py

+ 3 - 0
src/experiment.py

@@ -128,6 +128,7 @@ class Experiment:
 			try:
 				chutney_network = None
 				num_attempts = 0
+				start_time = time.time()
 				while chutney_network is None:
 					try:
 						num_attempts += 1
@@ -144,6 +145,8 @@ class Experiment:
 					#
 				#
 				num_lines_to_print = 50
+				time_to_create_network = time.time()-start_time
+				logging.debug('Chutney network started in {} seconds ({:.2f} minutes)'.format(round(time_to_create_network), time_to_create_network/60))
 				logging.debug('Last '+str(num_lines_to_print)+' lines of Chutney output:\n'+'\n'.join(chutney_network.startup_output.split('\n')[-num_lines_to_print:]))
 				if self.save_data_path is not None:
 					with open(os.path.join(self.save_data_path, 'chutney-startup.log'), 'w') as f: