Skip to content

Commit 5e5d1c1

Browse files
committed
Update README.md
1 parent d4beecc commit 5e5d1c1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ results = worker_dispatcher.start({
203203
The callback function called by each worker runs
204204

205205
```python
206-
callback_function (id: int, config, task, log: dict)
206+
callback_function (id: int, config, task, log: dict) -> Any
207207
```
208208

209209
|Argument |Type |Deafult |Description|
@@ -213,13 +213,15 @@ callback_function (id: int, config, task, log: dict)
213213
|task |multitype|(custom) |Each value from the `task.list`|
214214
|log |dict |{} |The log from each task written by this callback function.|
215215

216+
> The return value can be `False` to indicate task failure in TPS logs.
217+
> Alternatively, it can be a `requests.Response`, indicating failure if the status code is not 200.
216218
217219
#### task.result_callback
218220

219221
The callback function called when each task processes the result
220222

221223
```python
222-
result_callback_function (id: int, config, result, log: dict)
224+
result_callback_function (id: int, config, result, log: dict) -> Any
223225
```
224226

225227
|Argument |Type |Deafult |Description|
@@ -253,9 +255,7 @@ result_callback_function (id: int, config, result, log: dict)
253255
```python
254256
def get_tps(logs: dict=None, debug: bool=False, interval: float=0, reverse_interval: bool = False, display_intervals: bool = False) -> dict:
255257
```
256-
The log dict matches the format of the [get_logs()](#get_logs) and refers to it by default. Each `result` of a log will be considered valid if it meets one of the following conditions:
257-
- It is a `requests.Response` object with a status code of 200
258-
- It is a valid value other than the aforementioned object
258+
The log dict matches the format of the [get_logs()](#get_logs) and refers to it by default. Each task within a log will be validated for success according to the [callback_function](#task.result_callback) result rule.
259259

260260
### Scenarios
261261

0 commit comments

Comments
 (0)