Skip to content
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

Checking in the Producer #160

Open
rodrigotheodoropsv opened this issue Sep 6, 2022 · 5 comments
Open

Checking in the Producer #160

rodrigotheodoropsv opened this issue Sep 6, 2022 · 5 comments
Labels
❓ Question Further information is requested

Comments

@rodrigotheodoropsv
Copy link

Hello @mostafa.

First of all sorry for my english, I hope you understand my goal here.

I was thinking and trying to implement the extension, I've already used the last versions (v0.11 and before) that the script had a different implementation and I could check if the producer catch some error when it tried to write the message in the topic.

Could be interesting if we implement a step to return an error just to continuing to check it? I saw in the file " producer.go" at line 296 after the "Ifs" it will be interesting to return error and check it, because sometimes we are not testing the kafka, but we are tesnting the application that is consuming the messages that we are producing. That way we can just return the error and check in the script.js if the error != undefined we understand the produce got an error when it tried to write in the topic (Like the old way).

What do you think about?

Regards, Rodrigo.

@mostafa
Copy link
Owner

mostafa commented Sep 6, 2022

Hey @rodrigotheodoropsv,

I understand what you mean. In the current version, the errors are raised as exceptions, hence you need to use try..catch block to catch them. I hope it is clear enough, otherwise let me know if you need a code example.

@rodrigotheodoropsv
Copy link
Author

I'm trying to imagine how I can use k6's checks to check if my produce writes the message or get some error, just to create my metrics in base of this. Like the version v0.11, that the method produce return a error and normally we used the check about the return of the method. Sorry if my questions are silly or base.

@rodrigotheodoropsv
Copy link
Author

Like, is it possible to get the metrics from kafka "Metric: k.metrics.WriterErrors" and "Metric: k.metrics.WriterMessages" in my JS script? If it is, so I just need to learn how and I can go forward about it.

@mostafa
Copy link
Owner

mostafa commented Sep 7, 2022

@rodrigotheodoropsv

Like, is it possible to get the metrics from kafka "Metric: k.metrics.WriterErrors" and "Metric: k.metrics.WriterMessages" in my JS script? If it is, so I just need to learn how and I can go forward about it.

This is a valid point, and I'll make a ticket for it to export metrics.

@mostafa
Copy link
Owner

mostafa commented Sep 7, 2022

@rodrigotheodoropsv

I'm trying to imagine how I can use k6's checks to check if my produce writes the message or get some error, just to create my metrics in base of this. Like the version v0.11, that the method produce return a error and normally we used the check about the return of the method. Sorry if my questions are silly or base.

I'll try to come up with an example script, soon.

@mostafa mostafa added the ❓ Question Further information is requested label Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓ Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants