pjcalvo / locust-influxdb-listener

LocustIO base project with a custom influxDB listener.
MIT License
26 stars 20 forks source link

Adding tagging based on request context #16

Closed jmfiola closed 2 years ago

jmfiola commented 2 years ago

if someone now does something like: locustClient.get('asdf.com/get', context={'environment':'prod'}), then that environment tag will be added for that request when it is reported to influxdb. This allows us to do more granular filtering once we want to query that influxdb data.

There were also some linting changes that my Pycharm decided to do. I can get rid of those if you want! Thanks.

jmfiola commented 2 years ago

@pjcalvo FYI

pjcalvo commented 2 years ago

Will Merge and release tomorrow. Thanks for doing this.

jmfiola commented 2 years ago

I reverted almost all the formatting changes that my IDE was suggesting. There's a few pesky ones that it really wants me to do though..

Yes, the increase in the locust version is mandatory due to us now using the request hook instead of request_success and request_failure

pjcalvo commented 2 years ago

Awesome, I will take another look. Would you mind adding the required version somewhere in the top of the README.md file? Thanks

pjcalvo commented 2 years ago

So I checked locust logs and indeed the on_failure and on_success events are deprecated and will be removed soon, but the requests hook has been out since version 1.5.0 and not on 2.8.0 like this PR is suggesting. I will check if we can go back to 1.5.0 with success and then leave that version.

I would hate to force users to use upgrade to 2.8.0 for a feature that has been out since previous versions.

https://github.com/locustio/locust/releases/tag/1.5.0

jmfiola commented 2 years ago

@pjcalvo Changes have been made to versions and README as requested. Sorry this was a little late, I was on vacation!

pjcalvo commented 2 years ago

Nice thanks. I was also on holiday. One more small change and we are ready to release this version.

jmfiola commented 2 years ago

Nice thanks. I was also on holiday. One more small change and we are ready to release this version.

No worries! Change made. Thank you.