Skip to content

Commit

Permalink
Merge pull request #5 from nimiq/master
Browse files Browse the repository at this point in the history
NEW Update README.rst with new func_args and func_kwargs
  • Loading branch information
snelis committed Jan 27, 2016
2 parents d37d7e3 + 0d5cd37 commit 09f97bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ A hook will always get 3 arguments:
- `response` - The returned value of the wrapped function
- `exception` - The raised exception of the wrapped function
- `metric` - A dict containing the data to be send to the backend
- `func_args` - Original args received by the wrapped function.
- `func_kwargs` - Original kwargs received by the wrapped function.

From within a hook you can change the `name` if you want the metrics to be split
into multiple series.
Expand All @@ -114,7 +116,7 @@ See the following example how to setup hooks.
.. code-block:: python
# Now lets create a hook
def my_hook(response, exception, metric):
def my_hook(response, exception, metric, func_args, func_kwargs):
status_code = getattr(response, 'status_code', None)
if status_code:
return dict(
Expand Down

0 comments on commit 09f97bd

Please sign in to comment.