Beispiel #1
0
def __page_markup(program_runs):
    markup = report.header("Target report",
                           "For all scenarios: actions/s results vs targets",
                           "")
    markup += __program_runs_markup(program_runs)
    markup += __combined_results_markup(program_runs)
    markup += report.footer()
    return markup
def __page_markup(title, subtitle, config_run, metrics, dest_dir, run_id):
    markup = report.header(title, subtitle, "Scenarios")
    markup += """<div class="scenarios">"""

    scenarios = config_run["config_params"]["scenarios"]
    for scenario_name, scenario_config in scenarios.items():
        markup += __scenario_markup(scenario_name, scenario_config, metrics, dest_dir, run_id)
    markup += """</div>"""

    markup += report.section_title("General results for whole test config", "Normally less useful than scenario stats above because aggregated between different scenarios! Note that flows per second is not adjusted for multiple actions per scenario, so even if a scenario executes 100 actions in one scenario, the whole scenario is calculated as one action.")

    for chart in ["flows_clients", "flows_loadtime", "load", "duration", "active"]:
        markup += report.chart_markup(chart)
    markup += report.footer()
    return markup
def __page_markup(program_run_id, program_run):
    title = "Program report for %s" % (program_run_id)
    subtitle = program_run["run_description"]
    markup = report.header(title, subtitle, "Test config run reports (sets of scenario runs)")

    # add links to all test config reports
    run_list_markup = """<div class="config_runs">"""
    config_runs = program_run['config_runs']
    for config_run_name, config_run in config_runs.items():
        config_run_id = config_run["run_id"]
        link_title = "Config run (%s) %s" % (config_run_id, config_run_name)
        run_list_markup += report.link_title(paths.relative_path(complete_report_url(program_run_id), config_report.complete_report_url(config_run_id)), link_title, __config_run_1line_summary(config_run)) + "<br/>"
    run_list_markup += """</div>"""
    markup += run_list_markup

    markup += report.footer()
    return markup
Beispiel #4
0
def __page_markup(title, subtitle, config_run, metrics, dest_dir, run_id):
    markup = report.header(title, subtitle, "Scenarios")
    markup += """<div class="scenarios">"""

    scenarios = config_run["config_params"]["scenarios"]
    for scenario_name, scenario_config in scenarios.items():
        markup += __scenario_markup(scenario_name, scenario_config, metrics,
                                    dest_dir, run_id)
    markup += """</div>"""

    markup += report.section_title(
        "General results for whole test config",
        "Normally less useful than scenario stats above because aggregated between different scenarios! Note that flows per second is not adjusted for multiple actions per scenario, so even if a scenario executes 100 actions in one scenario, the whole scenario is calculated as one action."
    )

    for chart in [
            "flows_clients", "flows_loadtime", "load", "duration", "active"
    ]:
        markup += report.chart_markup(chart)
    markup += report.footer()
    return markup
def __page_markup(program_runs):
    markup = report.header("Target report", "For all scenarios: actions/s results vs targets", "")
    markup += __program_runs_markup(program_runs)
    markup += __combined_results_markup(program_runs)
    markup += report.footer()
    return markup
# -*- coding: utf-8 -*-

import sys
from datetime import date
import requests
from lxml import html
from settings import ARCHIVE_LINK, VISITED_LINKS
from export import get_path, get_original_text, save, lemmatisation
import report


chars_counter = 0
visited_links_file = open(VISITED_LINKS, 'r+')
visited_links = list(map(str.strip, visited_links_file.readlines()))
report.header()
headers = {
    'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36',
    'Accept-Encoding': 'deflate',
    'Accept-Language': 'en-US,en;q=0.5'
}



def str_to_date(string):
    m = ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля',
         'августа', 'сентября', 'октября', 'ноября', 'декабря']

    # ['10', 'февраля', '2016']
    try:
        day, month, year = string.split(' ')[3:6]
        # номер месяца - это индекс + 1