<commit_before># -*- coding: utf-8 -*-

import itertools
import json
import multiprocessing
import os
import re
import shutil
import urllib
import workerpool

import jobs

LAST_BUILD_URL_BASE = ('https://fuel-jenkins.mirantis.com/job/'
             'nailgun_performance_tests/lastCompletedBuild/')

LAST_BUILD_INFO = LAST_BUILD_URL_BASE + 'api/json'

LAST_BUILD_TAR_BASE = LAST_BUILD_URL_BASE + 'artifact/results/results/'

CSV_URL = LAST_BUILD_URL_BASE + 'artifact/nailgun/nailgun_perf_test_report.csv'

CSV_TARGET_PATH = '/usr/share/nginx/html/test_report.csv'

DOT_TARGET_DIR = 'dot/'

DOT_INDEX_PATH = 'graphs.json'


try:
    with open('build_number', 'r') as bn_file:
        previous_build_number = int(bn_file.read())
except (IOError, ValueError):
    previous_build_number = 0

current_build_info = json.loads(urllib.urlopen(LAST_BUILD_INFO).read())
<commit_msg>Move graphs.js to dot dir<commit_after># -*- coding: utf-8 -*-

import itertools
import json
import multiprocessing
import os
import re
import shutil
import urllib
import workerpool

import jobs

LAST_BUILD_URL_BASE = ('https://fuel-jenkins.mirantis.com/job/'
             'nailgun_performance_tests/lastCompletedBuild/')

LAST_BUILD_INFO = LAST_BUILD_URL_BASE + 'api/json'

LAST_BUILD_TAR_BASE = LAST_BUILD_URL_BASE + 'artifact/results/results/'

CSV_URL = LAST_BUILD_URL_BASE + 'artifact/nailgun/nailgun_perf_test_report.csv'

CSV_TARGET_PATH = '/usr/share/nginx/html/test_report.csv'

DOT_TARGET_DIR = 'dot/'

DOT_INDEX_PATH = 'dot/graphs.json'


try:
    with open('build_number', 'r') as bn_file:
        previous_build_number = int(bn_file.read())
except (IOError, ValueError):
    previous_build_number = 0

current_build_info = json.loads(urllib.urlopen(LAST_BUILD_INFO).read())

{'fraction_non_alphanumeric': 0.10921501706484642, 'fraction_numerical': 0.0022753128555176336, 'mean_word_length': 5.003412969283277, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '742996', 'n_tokens_mistral': 639, 'n_tokens_neox': 632, 'n_words': 112}