Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handler argument names. #314

Merged
merged 1 commit into from
Feb 15, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions docs/extending-locust.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ Locust comes with a number of events that provides hooks for extending locust in
Event listeners can be registered at the module level in a locust file. Here's an example::

from locust import events
def my_success_handler(method, path, response_time, response, **kw):
print "Successfully fetched: %s" % (path)

def my_success_handler(request_type, name, response_time, response_length, **kw):
print "Successfully fetched: %s" % (name)

events.request_success += my_success_handler

.. note::

It's highly recommended that you add a wildcard keyword argument in your listeners
(the \**kw in the code above), to prevent your code from breaking if new arguments are
It's highly recommended that you add a wildcard keyword argument in your listeners
(the \**kw in the code above), to prevent your code from breaking if new arguments are
added in a future version.

.. seealso::
Expand All @@ -28,11 +28,11 @@ Event listeners can be registered at the module level in a locust file. Here's a
Adding Web Routes
==================

Locust uses Flask to serve the web UI and therefore it is easy to add web end-points to the web UI.
Locust uses Flask to serve the web UI and therefore it is easy to add web end-points to the web UI.
Just import the Flask app in your locustfile and set up a new route::

from locust import web

@web.app.route("/added_page")
def my_added_page():
return "Another page"
Expand Down