瀏覽代碼

Log the time needed to start the network

Steven Engler 4 年之前
父節點
當前提交
40c046e089
共有 1 個文件被更改,包括 3 次插入0 次删除
  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: