1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
|
###
API
###
User class
============
.. autoclass:: locust.User
:members: wait_time, tasks, weight, fixed_count, abstract, on_start, on_stop, wait, context, environment
HttpUser class
================
.. autoclass:: locust.HttpUser
:members: wait_time, tasks, client, abstract
FastHttpUser class
==================
.. autoclass:: locust.contrib.fasthttp.FastHttpUser
:members: wait_time, tasks, client, abstract, rest
:noindex:
TaskSet class
=============
.. autoclass:: locust.TaskSet
:members: user, parent, wait_time, client, tasks, interrupt, schedule_task, on_start, on_stop, wait
task decorator
==============
.. autofunction:: locust.task
tag decorator
==============
.. autofunction:: locust.tag
SequentialTaskSet class
=======================
.. autoclass:: locust.SequentialTaskSet
:members: user, parent, wait_time, client, tasks, interrupt, schedule_task, on_start, on_stop
.. _wait_time_functions:
Built in wait_time functions
============================
.. automodule:: locust.wait_time
:members: between, constant, constant_pacing, constant_throughput
HttpSession class
=================
.. autoclass:: locust.clients.HttpSession
:members: __init__, request, get, post, delete, put, head, options, patch
Response class
==============
This class actually resides in the `requests <https://requests.readthedocs.io/>`_ library,
since that's what Locust is using to make HTTP requests, but it's included in the API docs
for locust since it's so central when writing locust load tests. You can also look at the
:py:class:`Response <requests.Response>` class at the
`requests documentation <https://requests.readthedocs.io/>`_.
.. autoclass:: requests.Response
:inherited-members:
:noindex:
ResponseContextManager class
============================
.. autoclass:: locust.clients.ResponseContextManager
:members: success, failure
.. _exceptions:
Exceptions
==========
.. autoexception:: locust.exception.InterruptTaskSet
.. autoexception:: locust.exception.RescheduleTask
.. autoexception:: locust.exception.RescheduleTaskImmediately
Environment class
=================
.. autoclass:: locust.env.Environment
:members:
.. _events:
Event hooks
===========
Locust provides event hooks that can be used to extend Locust in various ways.
The following event hooks are available under :py:attr:`Environment.events <locust.env.Environment.events>`,
and there's also a reference to these events under ``locust.events`` that can be used at the module level
of locust scripts (since the Environment instance hasn't been created when the locustfile is imported).
.. autoclass:: locust.event.Events
:members:
EventHook class
---------------
The event hooks are instances of the **locust.events.EventHook** class:
.. autoclass:: locust.event.EventHook
:members:
.. note::
It's highly recommended that you add a wildcard keyword argument in your event listeners
to prevent your code from breaking if new arguments are added in a future version.
Runner classes
=====================
.. autoclass:: locust.runners.Runner
:members: start, stop, quit, user_count
.. autoclass:: locust.runners.LocalRunner
.. autoclass:: locust.runners.MasterRunner
:members: register_message, send_message
.. autoclass:: locust.runners.WorkerRunner
:members: register_message, send_message, client_id, worker_index
Web UI class
============
.. autoclass:: locust.web.WebUI
:members:
Other
=====
.. autoclass:: locust.shape.LoadTestShape
:members:
.. autoclass:: locust.stats.RequestStats
:members: get
.. autoclass:: locust.stats.StatsEntry
.. autofunction:: locust.debug.run_single_user
|