-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add load-tester #487
Add load-tester #487
Conversation
13663e2
to
2dd438b
Compare
1086cad
to
f284618
Compare
I removed the cli reimplementation from this pull request again, as I will merge it separately with #513. |
8435d98
to
2eb696a
Compare
so we have added another generator that can send events to a http endpoint. @ppcad could you please do a review on this PR and check how we have integrated both generators into the new cli. As you can't approve your own pull request could you just give your feedback here as a comment. Then if everything is okay @djkhl can give her final approve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djkhl
I made some comments in code regarding the load tester.
Furthermore, I'm not sure how to use the event generator.
Using a config.yaml like this:
target_path: /some_endpoint
timestamps:
- key: TIMESTAMP_FIELD_1
format: "%Y%m%d"
- key: TIMESTAMP_FIELD_1
format: "%H%M%S"
time_shift: "+0200" # Optional, sets time shift in hours and minutes, if needed ([+-]HHMM)
yields the following error:
requests.exceptions.InvalidSchema: No connection adapters were found for '127.0.0.1:9000/some_endpoint'
However, the endpoint works if I use curl with the following command:
curl -X POST http://127.0.0.1:9000/some_endpoint -H 'Content-Type: application/json' -d '{"foo": "bar"}' --insecure
|
||
def run(self): | ||
"""Start function for the load-tester""" | ||
config = load_config(self.config, self.file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.file
is a bool (comes from --file via click, to activate using files), but it is used as source_file path instead of the source_file configuration option.
Therefore, the load tester is not working with a source file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just turned the cli --file
flag into an actual path. Can you please try it out again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you it works.
I did notice however that "--file" only works if a connection to Kafka exists, even if the documents are not retrieved from Kafka.
I believe that's a problem my original commit already had.
Maybe this could be changed in the future.
Looking at the error I assume you called the generator with |
Thank you for the clarification, it works. Everything looks good to me, except that a Kafka connection is required even if using "--file". |
c2668f1
to
6aa432f
Compare
rebased from main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
This PR adds two generator for load tests, both working against two different targets. The first one can send events to kafka and the second one can send events to an http endpoint.
Both generators are integrated into the new CLI.