Skip to content

Commit

Permalink
Merge pull request #2022 from kianmeng/fix-typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
cyberw authored Feb 22, 2022
2 parents 07b83c7 + 18965d7 commit 2c07551
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Even though Locust primarily works with web sites/services, it can be used to te

## Hackable

Locust's code base is intentionally kept small and doesnt solve everything out of the box. Instead, we try to make it easy to adapt to any situation you may come across, using regular Python code. If you want to [send reporting data to that database & graphing system you like](https://github.com/SvenskaSpel/locust-plugins/blob/master/examples/timescale_listener_ex.py), [wrap calls to a REST API](https://github.com/SvenskaSpel/locust-plugins/blob/master/examples/rest_ex.py) to handle the particulars of your system or run a [totally custom load pattern](https://docs.locust.io/en/latest/custom-load-shape.html#custom-load-shape), there is nothing stopping you!
Locust's code base is intentionally kept small and doesn't solve everything out of the box. Instead, we try to make it easy to adapt to any situation you may come across, using regular Python code. If you want to [send reporting data to that database & graphing system you like](https://github.com/SvenskaSpel/locust-plugins/blob/master/examples/timescale_listener_ex.py), [wrap calls to a REST API](https://github.com/SvenskaSpel/locust-plugins/blob/master/examples/rest_ex.py) to handle the particulars of your system or run a [totally custom load pattern](https://docs.locust.io/en/latest/custom-load-shape.html#custom-load-shape), there is nothing stopping you!

## Links

Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Number of users:

.. note::

Intepreting perfomance test results is quite complex (and mostly out of scope for this manual), but if your graphs start looking like this, the most likely reason is that your target service/system cannot handle the load you are hitting it with (it is overloaded or "saturated")
Interpreting performance test results is quite complex (and mostly out of scope for this manual), but if your graphs start looking like this, the most likely reason is that your target service/system cannot handle the load you are hitting it with (it is overloaded or "saturated")

The clearest sign of this is that when we get to around 9 users, response times start increasing so fast that the requests per second-curve flattens out, even though new users are still being added.

Expand Down
4 changes: 2 additions & 2 deletions docs/running-in-debugger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ Running tests in a debugger

Running Locust in a debugger is extremely useful when developing your tests. Among other things, you can examine a particular response or check some User instance variable.

But debuggers sometimes have issues with complex gevent-applications like Locust, and there is a lot going on in the framework itself that you probably arent interested in. To simplify this, Locust provides a method called :py:func:`run_single_user <locust.debug.run_single_user>`:
But debuggers sometimes have issues with complex gevent-applications like Locust, and there is a lot going on in the framework itself that you probably aren't interested in. To simplify this, Locust provides a method called :py:func:`run_single_user <locust.debug.run_single_user>`:

Note that this is fairly new feature, and the api is subject to change.

.. literalinclude:: ../examples/debugging.py
:language: python

It implicitly registeres an event handler for the :ref:`request <extending_locust>` event to print some stats about every request made:
It implicitly registers an event handler for the :ref:`request <extending_locust>` event to print some stats about every request made:

.. code-block:: console
Expand Down
2 changes: 1 addition & 1 deletion locust/argument_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def setup_parser_arguments(parser):
help="Quits Locust entirely, X seconds after the run is finished. Only used together with --autostart. The default is to keep Locust running until you shut it down using CTRL+C",
env_var="LOCUST_AUTOQUIT",
)
# Override --headless parameter (useful because you cant disable a store_true-parameter like headless once it has been set in a config file)
# Override --headless parameter (useful because you can't disable a store_true-parameter like headless once it has been set in a config file)
web_ui_group.add_argument(
"--headful",
action="store_true",
Expand Down
2 changes: 1 addition & 1 deletion locust/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class Events:
"""

def __init__(self):
# For backwarde compatiblilty use also values of class attributes
# For backwarde compatibility use also values of class attributes
for name, value in vars(type(self)).items():
if value == EventHook:
setattr(self, name, value())
Expand Down
22 changes: 11 additions & 11 deletions locust/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def user_classes_count(self) -> Dict[str, int]:
# the supplied args are emptied whenever the greenlet is dead, so we can
# simply ignore the greenlets with empty args.
logger.debug(
"ERROR: While calculating number of running users, we encountered a user that didnt have proper args %s (user_greenlet.dead=%s)",
"ERROR: While calculating number of running users, we encountered a user that didn't have proper args %s (user_greenlet.dead=%s)",
user_greenlet,
user_greenlet.dead,
)
Expand Down Expand Up @@ -247,7 +247,7 @@ def stop_users(self, user_classes_stop_count: Dict[str, int]):
user = user_greenlet.args[0]
except IndexError:
logger.error(
"While stopping users, we encountered a user that didnt have proper args %s", user_greenlet
"While stopping users, we encountered a user that didn't have proper args %s", user_greenlet
)
continue
if isinstance(user, self.user_classes_by_name[user_class]):
Expand Down Expand Up @@ -411,7 +411,7 @@ def shape_worker(self):
# Because the first stage will take 100s to complete, the second stage
# will be skipped completely because the shape worker will be blocked
# at the `self.start()` of the first stage.
# Of couse, this isn't a problem if the load test shape is well-defined.
# Of course, this isn't a problem if the load test shape is well-defined.
# We should probably use a `gevent.timeout` with a duration a little over
# `(user_count - prev_user_count) / spawn_rate` in order to limit the runtime
# of each load test shape stage.
Expand Down Expand Up @@ -482,7 +482,7 @@ def __init__(self, environment):
"""
super().__init__(environment)

# register listener thats logs the exception for the local runner
# register listener that's logs the exception for the local runner
def on_user_error(user_instance, exception, tb):
formatted_tb = "".join(traceback.format_tb(tb))
self.log_exception("local", str(exception), formatted_tb)
Expand Down Expand Up @@ -521,7 +521,7 @@ def send_message(self, msg_type, data=None):
msg = Message(msg_type, data, "local")
listener(environment=self.environment, msg=msg)
else:
logger.warning(f"Unknown message type recieved: {msg_type}")
logger.warning(f"Unknown message type received: {msg_type}")


class DistributedRunner(Runner):
Expand Down Expand Up @@ -757,7 +757,7 @@ def start(self, user_count: int, spawn_rate: float, wait=False) -> None:
gevent.sleep(0.01)
except gevent.Timeout:
msg_prefix = (
"Spawning is complete and report waittime is expired, but not all reports recieved from workers"
"Spawning is complete and report waittime is expired, but not all reports received from workers"
)
finally:
timeout.cancel()
Expand Down Expand Up @@ -975,10 +975,10 @@ def client_listener(self):
elif msg.type == "exception":
self.log_exception(msg.node_id, msg.data["msg"], msg.data["traceback"])
elif msg.type in self.custom_messages:
logger.debug(f"Recieved {msg.type} message from worker {msg.node_id}")
logger.debug(f"Received {msg.type} message from worker {msg.node_id}")
self.custom_messages[msg.type](environment=self.environment, msg=msg)
else:
logger.warning(f"Unknown message type recieved from worker {msg.node_id}: {msg.type}")
logger.warning(f"Unknown message type received from worker {msg.node_id}: {msg.type}")

self.check_stopped()

Expand Down Expand Up @@ -1067,7 +1067,7 @@ def on_quitting(environment, **kw):

self.environment.events.quitting.add_listener(on_quitting)

# register listener thats sends user exceptions to master
# register listener that's sends user exceptions to master
def on_user_error(user_instance, exception, tb):
formatted_tb = "".join(traceback.format_tb(tb))
self.client.send(Message("exception", {"msg": str(exception), "traceback": formatted_tb}, self.client_id))
Expand Down Expand Up @@ -1196,10 +1196,10 @@ def worker(self):
self._send_stats() # send a final report, in case there were any samples not yet reported
self.greenlet.kill(block=True)
elif msg.type in self.custom_messages:
logger.debug(f"Recieved {msg.type} message from master")
logger.debug(f"Received {msg.type} message from master")
self.custom_messages[msg.type](environment=self.environment, msg=msg)
else:
logger.warning(f"Unknown message type recieved: {msg.type}")
logger.warning(f"Unknown message type received: {msg.type}")

def stats_reporter(self):
while True:
Expand Down
2 changes: 1 addition & 1 deletion locust/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def resize_handler(signum, frame):
try:
signal.signal(signal.SIGWINCH, resize_handler)
except AttributeError:
pass # Windows doesnt have SIGWINCH
pass # Windows doesn't have SIGWINCH

STATS_TYPE_WIDTH = 8

Expand Down
8 changes: 4 additions & 4 deletions locust/test/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def test_autostart_wo_run_time(self):
self.assertIn("No run time limit set, use CTRL+C to interrupt", stderr)
self.assertIn("Shutting down ", stderr)
self.assertNotIn("Traceback", stderr)
# check response afterwards, because it really isnt as informative as stderr
# check response afterwards, because it really isn't as informative as stderr
self.assertEqual(200, response.status_code)
self.assertIn('<body class="running">', response.text)

Expand Down Expand Up @@ -466,7 +466,7 @@ def test_autostart_w_run_time(self):
self.assertIn("Run time limit set to 2 seconds", stderr)
self.assertIn("Shutting down ", stderr)
self.assertNotIn("Traceback", stderr)
# check response afterwards, because it really isnt as informative as stderr
# check response afterwards, because it really isn't as informative as stderr
self.assertEqual(200, response.status_code)
self.assertIn('<body class="running">', response.text)

Expand Down Expand Up @@ -516,7 +516,7 @@ def tick(self):
self.assertIn("Shape test starting", stderr)
self.assertIn("Shutting down ", stderr)
self.assertIn("autoquit time reached", stderr)
# check response afterwards, because it really isnt as informative as stderr
# check response afterwards, because it really isn't as informative as stderr
self.assertEqual(200, response.status_code)
self.assertIn('<body class="spawning">', response.text)
self.assertTrue(success, "got timeout and had to kill the process")
Expand Down Expand Up @@ -987,7 +987,7 @@ def t(self):
proc_worker.communicate()

self.assertIn(
'Spawning is complete and report waittime is expired, but not all reports recieved from workers: {"User1": 2} (2 total users)',
'Spawning is complete and report waittime is expired, but not all reports received from workers: {"User1": 2} (2 total users)',
stdout,
)
self.assertIn("Shutting down (exit code 0)", stdout)
Expand Down
6 changes: 3 additions & 3 deletions locust/test/test_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def on_custom_msg(msg, **kw):
self.assertFalse(test_custom_msg[0])
self.assertEqual(1, len(self.mocked_log.warning))
msg = self.mocked_log.warning[0]
self.assertIn("Unknown message type recieved", msg)
self.assertIn("Unknown message type received", msg)

def test_swarm_endpoint_is_non_blocking(self):
class TestUser1(User):
Expand Down Expand Up @@ -2605,7 +2605,7 @@ def on_custom_msg(msg, **kw):
self.assertFalse(test_custom_msg[0])
self.assertEqual(1, len(self.mocked_log.warning))
msg = self.mocked_log.warning[0]
self.assertIn("Unknown message type recieved from worker", msg)
self.assertIn("Unknown message type received from worker", msg)

def test_wait_for_workers_report_after_ramp_up(self):
def assert_cache_hits():
Expand Down Expand Up @@ -3087,7 +3087,7 @@ def on_custom_msg(msg, **kw):
self.assertFalse(test_custom_msg[0])
self.assertEqual(1, len(self.mocked_log.warning))
msg = self.mocked_log.warning[0]
self.assertIn("Unknown message type recieved", msg)
self.assertIn("Unknown message type received", msg)

def test_start_event(self):
class MyTestUser(User):
Expand Down
2 changes: 1 addition & 1 deletion locust/user/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class ForumPage(TaskSet):
fixed_count = 0
"""
If the value > 0, the weight property will be ignored and the 'fixed_count'-instances will be spawned.
These Users are spawned first. If the total target count (specified by the --users arg) is not enougth
These Users are spawned first. If the total target count (specified by the --users arg) is not enough
to spawn all instances of each User class with the defined property, the final count of each User is undefined.
"""

Expand Down
4 changes: 2 additions & 2 deletions locust/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def swarm():

parsed_options_dict = vars(environment.parsed_options) if environment.parsed_options else {}
for key, value in request.form.items():
if key == "user_count": # if we just renamed this field to "users" we wouldnt need this
if key == "user_count": # if we just renamed this field to "users" we wouldn't need this
user_count = int(value)
elif key == "spawn_rate":
spawn_rate = float(value)
Expand All @@ -151,7 +151,7 @@ def swarm():
environment.host = str(request.form["host"]).replace("<", "").replace(">", "")
elif key in parsed_options_dict:
# update the value in environment.parsed_options, but dont change the type.
# This wont work for parameters that are None
# This won't work for parameters that are None
parsed_options_dict[key] = type(parsed_options_dict[key])(value)

if environment.shape_class:
Expand Down

0 comments on commit 2c07551

Please sign in to comment.