<commit_before># (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)


"""
Dragged from datadog agent http_check here: https://github.com/DataDog/dd-agent/blob/8dfe2251b957039034fd1f199aa8da1158200207/checks.d/http_check.py

Only changes are to always track the metric for response time, while also tagging the status code.
"""

# stdlib
from datetime import datetime
import _strptime # noqa
import os.path
from os import environ
import re
import socket
import ssl
import time
import warnings
from urlparse import urlparse

# 3rd party
import requests
import tornado

from requests.adapters import HTTPAdapter
from requests.packages import urllib3
from requests.packages.urllib3.util import ssl_

from requests.packages.urllib3.exceptions import (
    SecurityWarning,
)
from requests.packages.urllib3.packages.ssl_match_hostname import \
    match_hostname

# project
from checks.network_checks import EventType, NetworkCheck, Status
from config import _is_affirmative<commit_msg>Adding uptime metrics.<commit_after># (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)


"""
Dragged from datadog agent http_check here: https://github.com/DataDog/dd-agent/blob/8dfe2251b957039034fd1f199aa8da1158200207/checks.d/http_check.py

Only changes are to always track the metric for response time, while also tagging the status code.

Uptime:
sum:bn.network.http.response_time.count{status_code:200} by {url}/(sum:bn.network.http.response_time.count{status_code:200} by {url} + sum:bn.network.http.response_time.count{!status_code:200} by {url}) * 100.0
"""

# stdlib
from datetime import datetime
import _strptime # noqa
import os.path
from os import environ
import re
import socket
import ssl
import time
import warnings
from urlparse import urlparse

# 3rd party
import requests
import tornado

from requests.adapters import HTTPAdapter
from requests.packages import urllib3
from requests.packages.urllib3.util import ssl_

from requests.packages.urllib3.exceptions import (
    SecurityWarning,
)
from requests.packages.urllib3.packages.ssl_match_hostname import \
    match_hostname

# project
from checks.network_checks import EventType, NetworkCheck, Status
from config import _is_affirmative
{'fraction_non_alphanumeric': 0.06840958605664488, 'fraction_numerical': 0.04226579520697168, 'mean_word_length': 5.5413105413105415, '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': '7126109', 'n_tokens_mistral': 763, 'n_tokens_neox': 695, 'n_words': 219}