<commit_before># opts.py - module to parse command line options and output what parameters will be used for this run

import os
import os.path
import json
import sys
import common
from common import OK, NOTOK, FsDriftException
import argparse
import parser_data_types
from parser_data_types import boolean, positive_integer, non_negative_integer, bitmask
from parser_data_types import positive_float, non_negative_float, positive_percentage
from parser_data_types import host_set, file_access_distrib, directory_list

def getenv_or_default(var_name, var_default):
    v = os.getenv(var_name)
    if v == None:
        v = var_default
    return v

# command line parameter variables here

class FsDriftOpts:
    def __init__(self):
        self.top_directory = '/tmp/foo'
        self.output_json_path = None  # filled in later
        self.host_set = [] # default is local test
        self.threads = 2 #  number of subprocesses per host
        self.is_slave = False
        self.duration = 1
        self.max_files = 200
        self.max_file_size_kb = 10
        self.max_record_size_kb = 1
        self.max_random_reads = 2
        self.max_random_writes = 2
        self.fdatasync_probability_pct = 10
        self.fsync_probability_pct = 20
        self.levels = 2
        self.subdirs_per_dir = 3
        self.rsptimes = False
        self.workload_table_csv_path = None<commit_msg>no directory_list type needed in fs-drift<commit_after># opts.py - module to parse command line options and output what parameters will be used for this run

import os
import os.path
import json
import sys
import common
from common import OK, NOTOK, FsDriftException
import argparse
import parser_data_types
from parser_data_types import boolean, positive_integer, non_negative_integer, bitmask
from parser_data_types import positive_float, non_negative_float, positive_percentage
from parser_data_types import host_set, file_access_distrib

def getenv_or_default(var_name, var_default):
    v = os.getenv(var_name)
    if v == None:
        v = var_default
    return v

# command line parameter variables here

class FsDriftOpts:
    def __init__(self):
        self.top_directory = '/tmp/foo'
        self.output_json_path = None  # filled in later
        self.host_set = [] # default is local test
        self.threads = 2 #  number of subprocesses per host
        self.is_slave = False
        self.duration = 1
        self.max_files = 200
        self.max_file_size_kb = 10
        self.max_record_size_kb = 1
        self.max_random_reads = 2
        self.max_random_writes = 2
        self.fdatasync_probability_pct = 10
        self.fsync_probability_pct = 20
        self.levels = 2
        self.subdirs_per_dir = 3
        self.rsptimes = False
        self.workload_table_csv_path = None
{'fraction_non_alphanumeric': 0.054441260744985676, 'fraction_numerical': 0.011461318051575931, 'mean_word_length': 3.1073529411764707, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7157638', 'n_tokens_mistral': 877, 'n_tokens_neox': 842, 'n_words': 249}