<commit_before>from locust import HttpLocust, TaskSet, task


class SmokeBehavior(TaskSet):
    """
    Request behavior that represents some standard production behavior.
    Tasks uris are hard-coded for now, but could be stored or even dynamically
    generated later.
    See https://bugzil.la/1186085
    """

    @task(weight=265)
    def home(self):
        self.client.get('/en-US/')

    @task(weight=185)
    def midas(self):
        self.client.get('/en-US/docs/Mozilla/Projects/Midas/Security_preferences')

    @task(weight=143)
    def js(self):
        self.client.get('/en-US/docs/Web/JavaScript')
<commit_msg>bug 1189451 - add 'Host' header<commit_after>import os

from locust import HttpLocust, TaskSet, task


class SmokeBehavior(TaskSet):
    """
    Request behavior that represents some standard production behavior.
    Tasks uris are hard-coded for now, but could be stored or even dynamically
    generated later.
    See https://bugzil.la/1186085
    """

    def on_start(self):
        locust_host = os.environ.get('LOCUST_HOST', 'developer.allizom.org')
        self.client.headers['Host'] = locust_host

    @task(weight=265)
    def home(self):
        self.client.get('/en-US/')

    @task(weight=185)
    def midas(self):
        self.client.get('/en-US/docs/Mozilla/Projects/Midas/Security_preferences')

    @task(weight=143)
    def js(self):
        self.client.get('/en-US/docs/Web/JavaScript')

{'fraction_non_alphanumeric': 0.12491277041172366, 'fraction_numerical': 0.02721563154221912, 'mean_word_length': 3.097142857142857, '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': '5972185', 'n_tokens_mistral': 498, 'n_tokens_neox': 455, 'n_words': 103}