<commit_before># -*- coding: utf-8 -*-
import concurrent.futures
import os
import sqlite3
import tarfile
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor

import requests

from cli_common.log import get_logger
from code_coverage_bot import grcov
from code_coverage_bot import taskcluster

logger = get_logger(__name__)

# TODO: Change the IP to a domain name when bug 1429482 is fixed.
ACTIVEDATA_QUERY_URL = 'http://192.168.3.11/query'

PLATFORMS = ['linux', 'windows']
IGNORED_SUITE_PREFIXES = ['awsy', 'talos', 'test-coverage', 'test-coverage-wpt']
# TODO: Calculate this dinamically when https://github.com/klahnakoski/ActiveData-ETL/issues/40 is fixed.
TEST_COVERAGE_SUITES = ['reftest', 'web-platform', 'mochitest', 'xpcshell', 'jsreftest', 'crashtest']


def get_suites(revision):
    r = requests.post(ACTIVEDATA_QUERY_URL, json={
        'from': 'unittest',
        'where': {'and': [
            {'eq': {'repo.branch.name': 'mozilla-central'}},
            {'eq': {'repo.changeset.id12': revision[:12]}},
            {'or': [
                {'prefix': {'run.key': 'test-linux64-ccov'}},
                {'prefix': {'run.key': 'test-windows10-64-ccov'}}
            ]}
        ]},
        'limit': 500000,
        'groupby': ['run.suite.fullname']
    })

    suites_data = r.json()['data']

    return [e[0] for e in suites_data]


# Retrieve chunk -> tests mapping from ActiveData.
def get_tests_chunks(revision, platform, suite):
    if platform == 'linux':<commit_msg>codecoverage/bot: Update ActiveData query URL (#1644)<commit_after># -*- coding: utf-8 -*-
import concurrent.futures
import os
import sqlite3
import tarfile
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor

import requests

from cli_common.log import get_logger
from code_coverage_bot import grcov
from code_coverage_bot import taskcluster

logger = get_logger(__name__)

ACTIVEDATA_QUERY_URL = 'http://activedata.allizom.org/query'

PLATFORMS = ['linux', 'windows']
IGNORED_SUITE_PREFIXES = ['awsy', 'talos', 'test-coverage', 'test-coverage-wpt']
# TODO: Calculate this dinamically when https://github.com/klahnakoski/ActiveData-ETL/issues/40 is fixed.
TEST_COVERAGE_SUITES = ['reftest', 'web-platform', 'mochitest', 'xpcshell', 'jsreftest', 'crashtest']


def get_suites(revision):
    r = requests.post(ACTIVEDATA_QUERY_URL, json={
        'from': 'unittest',
        'where': {'and': [
            {'eq': {'repo.branch.name': 'mozilla-central'}},
            {'eq': {'repo.changeset.id12': revision[:12]}},
            {'or': [
                {'prefix': {'run.key': 'test-linux64-ccov'}},
                {'prefix': {'run.key': 'test-windows10-64-ccov'}}
            ]}
        ]},
        'limit': 500000,
        'groupby': ['run.suite.fullname']
    })

    suites_data = r.json()['data']

    return [e[0] for e in suites_data]


# Retrieve chunk -> tests mapping from ActiveData.
def get_tests_chunks(revision, platform, suite):
    if platform == 'linux':
{'fraction_non_alphanumeric': 0.15056254136333555, 'fraction_numerical': 0.020516214427531435, 'mean_word_length': 3.5733736762481088, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '1559967', 'n_tokens_mistral': 1063, 'n_tokens_neox': 998, 'n_words': 231}