Skip to content

Jdennison/expose stats callback #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

Closed

Conversation

johnistan
Copy link
Contributor

I am actively investigating this client and needed topic lag for consumers. I exposed the underlying on_stats callback in librdkafka.

If you would actually like to use this it needs doc strings and likely the addition of the same callback in the producer.

Also, I wanted to expose a dict to the callback. I have no idea if just calling the builtin python json module is a good idea. My C/python C-api skills are limited.

Also, this api is good for my consumers. However, I also have use cases for synchronous querying of the offset lag and current offsets in a topic within a monitoring client(i.e. no active consumption is occurring). Does librdkafka support something like this, or is it only a callback.

@ghost
Copy link

ghost commented May 27, 2016

Hey @jofusa,
thank you for your Pull Request.

@confluentinc It looks like this brave person signed our Contributor License Agreement. 👍

Always at your service,

clabot

@edenhill
Copy link
Contributor

edenhill commented Jun 4, 2016

Thanks for your PR.

I do agree that the stats callback is indeed useful and it should be exposed.
But I'm not certain that auto-translating to a dict is the right choice, it increases the C complexity unproportionally to what the corresponding Python code would be (about two lines of code, including import). Let's see if it makes sense to move the JSON conversion to the Python shim.

@edenhill
Copy link
Contributor

edenhill commented Nov 2, 2016

Thanks for your contribution, this was added as part of #55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants