def setup_system(): # This function will setup the zfs filesystems, it does not perform # any checks, call it when you know this machine needs to be set up subprocess.check_call(['zfs', 'create', '-p', Configs.test_filesystem_path, '-o', "mountpoint=" + Configs.mount_point]) # Create the corpus directory, currently setting primarycahce=none # since not doing so results in abnormalities in test timing. I # think this will become especially useful when this process # becomes multithreaded. subprocess.check_call(['zfs', 'create', Configs.test_filesystem_path + '/corpus', '-o', 'primarycache=none']) # Create the area for test runs to go. I keep this in a separate # area to ensure that cleanup is easy ZfsApi.create_filesystem(Configs.test_filesystem_path + '/runs') # Create the log directory, and its two sub directories ZfsApi.create_filesystem(Configs.test_filesystem_path + '/logs') # The two sub directories are not zfs filesystems os.mkdir(Configs.results_directory) os.mkdir(Configs.stats_directory)
def setup_system(): # This function will setup the zfs filesystems, it does not perform # any checks, call it when you know this machine needs to be set up subprocess.check_call([ 'zfs', 'create', '-p', Configs.test_filesystem_path, '-o', "mountpoint=" + Configs.mount_point ]) # Create the corpus directory, currently setting primarycahce=none # since not doing so results in abnormalities in test timing. I # think this will become especially useful when this process # becomes multithreaded. subprocess.check_call([ 'zfs', 'create', Configs.test_filesystem_path + '/corpus', '-o', 'primarycache=none' ]) # Create the area for test runs to go. I keep this in a separate # area to ensure that cleanup is easy ZfsApi.create_filesystem(Configs.test_filesystem_path + '/runs') # Create the log directory, and its two sub directories ZfsApi.create_filesystem(Configs.test_filesystem_path + '/logs') # The two sub directories are not zfs filesystems os.mkdir(Configs.results_directory) os.mkdir(Configs.stats_directory)
# Establish where this test will be writing its output current_min = time.strftime("%Y%m%d%H%M%S") zfs_receive_path = Configs.test_filesystem_path + '/runs/' + current_min start_txg = ZfsApi.get_current_txg(Configs.main_pool) results_collector = Results.ResultsCollector(zfs_receive_path) results_collector.gather_start_results() if args.verbose: monitor_thread = MonitorThread.MonitorThread(zfs_receive_path) monitor_thread.start() # Create the base FS that each thread will be receiveing into sub filesystem ZfsApi.create_filesystem(zfs_receive_path) start_time = time.time() def receive_file(zfs_filesystem): ZfsApi.zfs_recv(Configs.test_file_full_path, zfs_filesystem) try: zfs_filesystem_list = [] for count in xrange(args.threads): zfs_filesystem_list.append(zfs_receive_path + '/' + str(count)) workerPool = multiprocessing.Pool(processes=args.threads) workerPool.map(receive_file, zfs_filesystem_list) workerPool.close() workerPool.join() except KeyboardInterrupt:
# Establish where this test will be writing its output current_min = time.strftime("%Y%m%d%H%M%S") zfs_receive_path = Configs.test_filesystem_path + "/runs/" + current_min start_txg = ZfsApi.get_current_txg(Configs.main_pool) results_collector = Results.ResultsCollector(zfs_receive_path) results_collector.gather_start_results() if args.verbose: monitor_thread = MonitorThread.MonitorThread(zfs_receive_path) monitor_thread.start() # Create the base FS that each thread will be receiveing into sub filesystem ZfsApi.create_filesystem(zfs_receive_path) start_time = time.time() def receive_file(zfs_filesystem): ZfsApi.zfs_recv(Configs.test_file_full_path, zfs_filesystem) try: zfs_filesystem_list = [] for count in xrange(args.threads): zfs_filesystem_list.append(zfs_receive_path + "/" + str(count)) workerPool = multiprocessing.Pool(processes=args.threads) workerPool.map(receive_file, zfs_filesystem_list) workerPool.close()