예제 #1
0
def analyze_data(global_params, pattern, ignore_list, detail, rampup_value=0,
                 max_rampup_value=0, current_dir=""):
    if rampup_value > 0:
        pattern = pattern + "*.hw"

    # Extracting regex and path
    path = os.path.dirname(pattern)
    if not path:
        path = "."
    else:
        pattern = os.path.basename(pattern)

    if not os.path.isdir(path):
        print("Error: the path %s doesn't exists !" % path)
        sys.exit(2)

    health_data_file = utils.find_file(path, pattern)
    if len(health_data_file) == 0:
        print("No log file found with pattern %s!" % pattern)
        sys.exit(1)
    else:
        if rampup_value == 0:
            print("### %d files Selected with pattern '%s' ###" %
                  (len(health_data_file), pattern))
        else:
            print("########## Rampup: %d / %d hosts #########" %
                  (rampup_value, max_rampup_value))

    # Extract data from the hw files
    bench_values = []
    for health in health_data_file:
        bench_values.append(eval(open(health).read()))

    if rampup_value > 0:
        unique_id = 'uuid'
    else:
        unique_id = 'serial'

    # Extracting the host list from the data to get
    # the initial list of hosts. We have here a single group
    # with all the servers
    systems_groups = []
    systems_groups.append(utils.get_hosts_list(bench_values, unique_id))

    # Let's create groups of similar servers
    if rampup_value == 0:
        group_systems(global_params, bench_values, unique_id, systems_groups,
                      ignore_list)
        compare_sets.print_systems_groups(systems_groups)

    # It's time to compare performance in each group
    compare_performance(bench_values, unique_id, systems_groups, detail,
                        rampup_value, current_dir)
    print("##########################################")
    print()
    return bench_values
예제 #2
0
def load_samples(bench_values):
    for health in utils.find_file(os.path.join(_BASEDIR, 'cardiff_samples'),
                                  '*.hw_'):
        bench_values.append(eval(open(health).read()))
예제 #3
0
파일: cardiff.py 프로젝트: jovial/hardware
def analyze_data(global_params,
                 pattern,
                 ignore_list,
                 detail,
                 rampup_value=0,
                 max_rampup_value=0,
                 current_dir=""):
    if rampup_value > 0:
        pattern = pattern + "*.hw"

    # Extracting regex and path
    path = os.path.dirname(pattern)
    if not path:
        path = "."
    else:
        pattern = os.path.basename(pattern)

    if not os.path.isdir(path):
        print("Error: the path %s doesn't exists !" % path)
        sys.exit(2)

    health_data_file = utils.find_file(path, pattern)
    if not health_data_file:
        print("No log file found with pattern %s!" % pattern)
        sys.exit(1)

    if rampup_value == 0:
        print("### %d files Selected with pattern '%s' ###" %
              (len(health_data_file), pattern))
    else:
        print("########## Rampup: %d / %d hosts #########" %
              (rampup_value, max_rampup_value))

    # Extract data from the hw files
    bench_values = []
    for health in health_data_file:
        bench_values.append(eval(open(health).read()))

    if rampup_value > 0:
        unique_id = 'uuid'
    else:
        unique_id = 'serial'

    # Extracting the host list from the data to get
    # the initial list of hosts. We have here a single group
    # with all the servers
    systems_groups = []
    systems_groups.append(utils.get_hosts_list(bench_values, unique_id))

    # Let's create groups of similar servers
    if rampup_value == 0:
        group_systems(global_params, bench_values, unique_id, systems_groups,
                      ignore_list)
        compare_sets.print_systems_groups(systems_groups)

    # It's time to compare performance in each group
    compare_performance(bench_values, unique_id, systems_groups, detail,
                        rampup_value, current_dir)
    print("##########################################")
    print()
    return bench_values
예제 #4
0
def load_samples(bench_values):
    for health in utils.find_file(os.path.join(_BASEDIR, 'cardiff_samples'),
                                  '*.hw_'):
        bench_values.append(eval(open(health).read()))