Example #1
0
def run_collect(opts):
    distutils.dir_util.copy_tree("css", opts.reports_dir + "/css")
    distutils.dir_util.copy_tree("fonts", opts.reports_dir + "/fonts")
    distutils.dir_util.copy_tree("js", opts.reports_dir + "/js")
    task_dir_list = glob.glob(opts.results_dir + '/*/*/*/*/*/*/*/*/*')
    pool = Pool(processes=processes_count)
    results = [
        pool.apply(collect_iteration, args=(opts, task_dir))
        for task_dir in task_dir_list
    ]
    #for task_dir in task_dir_list:
    #   collect_iteration(opts, task_dir)
    # creating reference page

    html_dir_list = glob.glob(opts.reports_dir + '/*/*/*/*/*/*/*/*/*/*.html')
    tmp_tree = []
    for report_file in html_dir_list:
        tmp_tree.append(report_file[(len(opts.reports_dir) + 1):])
    result_tree = build_tree(tmp_tree)
    f = open(opts.reports_dir + '/index.html', 'w')
    helper.write_head(f, "", "reference.html")
    f.write('<body>\n' + '<div class="container">' + '<div class="row">' +
            '<h2>Reference</h2>' + '<hr>' +
            '<div id="includedContent"></div>' + '</div>' + '</div>' +
            '</body>' + '</html>')
    f.close()
    f = open(opts.reports_dir + '/reference.html', 'w')
    print_tree(result_tree, f, "", "", True)
    f.close()
    f = open(opts.reports_dir + '/reference_for_leafs.html', 'w')
    print_tree(result_tree, f, "", "../../../../../../../../../", True)
    f.close()
Example #2
0
def result_commit(results_dir, report_dir, task_list, task_name, task_id):
    """
    Add all logs results and graphs to MarkDown files.
    :param result_dir: string. Path to all graphs.
    :param report_dir: string. Path to the directory where all results will be
placed.
    :param task_list: list[string]. Name of the task, represented in list.
Basically, path to task in form of list.
    :param task_name: string. The Name of the task. For example,
'infinispan-embedded-x12'
    :param task_id: int. The unique number for particular task. For example,
you can use end time value of the task.
    """
    dir_list = []
    all_directories = []
    for f in os.listdir(results_dir):
        if os.path.isdir(os.path.join(results_dir, f)):
            all_directories.append(os.path.join(results_dir, f))
    for i_directory in all_directories:
        dir_list.append(i_directory)

    new_result_file = open(report_dir + "/" + task_name + ".html", "w")
    # new_result_file = open(report_dir + "/" + "report.html", "w")
    helper.write_head(
        new_result_file, "../../../../../../../../../",
        "reference_for_leafs.html")
    html_file_title = '<h3>'
    for i in task_list:
        html_file_title += i + ' '
    html_file_title += '<h3>\n'
    new_result_file.write(
        '<body>\n' +
        '<div id="includedContent"></div>' +
        html_file_title)

    result_list = write_monitor_graphs(
        new_result_file, dir_list)
    new_result_file.write("\n<p>Client information</p>")
    all_images = []
    for f in os.listdir(results_dir):
        if os.path.isfile(os.path.join(results_dir, f)) and f[-4:] == ".png":
            all_images.append(os.path.join(results_dir, f))

    client_file_faults = open(results_dir + "/faults", "r")
    client_file_values = open(results_dir + "/values", "r")
    result_list.append(write_client_graphs(
        new_result_file, all_images, client_file_faults,
        client_file_values))
    client_file_faults.close()
    client_file_values.close()

    new_result_file.write(
        "\n</body>\n" +
        "</html>")
    new_result_file.close()

    write_tsv_results(result_list, report_dir)
Example #3
0
def run_collect(opts):
    distutils.dir_util.copy_tree("css", opts.reports_dir + "/css")
    distutils.dir_util.copy_tree("fonts", opts.reports_dir + "/fonts")
    distutils.dir_util.copy_tree("js", opts.reports_dir + "/js")
    task_dir_list = glob.glob(opts.results_dir + '/*/*/*/*/*/*/*/*/*')
    pool = Pool(processes=processes_count)
    results = [pool.apply(collect_iteration, args=(opts, task_dir)) for task_dir in task_dir_list]
    #for task_dir in task_dir_list:
    #   collect_iteration(opts, task_dir)
    # creating reference page
    
    html_dir_list = glob.glob(opts.reports_dir + '/*/*/*/*/*/*/*/*/*/*.html')
    tmp_tree = []
    for report_file in html_dir_list:
        tmp_tree.append(report_file[(len(opts.reports_dir) + 1):])
    result_tree = build_tree(tmp_tree)
    f = open(opts.reports_dir + '/index.html', 'w')
    helper.write_head(f, "", "reference.html")
    f.write(
        '<body>\n' +
        '<div class="container">' +
        '<div class="row">' +
        '<h2>Reference</h2>' +
        '<hr>' +
        '<div id="includedContent"></div>' +
        '</div>' +
        '</div>' +
        '</body>' +
        '</html>')
    f.close()
    f = open(opts.reports_dir + '/reference.html', 'w')
    print_tree(result_tree, f, "", "", True)
    f.close()
    f = open(opts.reports_dir + '/reference_for_leafs.html', 'w')
    print_tree(result_tree, f, "", "../../../../../../../../../", True)
    f.close()