Skip to content

Improve handling of kafka offsets and capabilities of the monitor#86

Open
flowln wants to merge 11 commits intocnpem:mainfrom
flowln:better_kafka_monitor
Open

Improve handling of kafka offsets and capabilities of the monitor#86
flowln wants to merge 11 commits intocnpem:mainfrom
flowln:better_kafka_monitor

Conversation

@flowln
Copy link
Copy Markdown
Contributor

@flowln flowln commented Mar 12, 2026

This PR is kind of a sinkhole where I've put everything I wanted to change in the Kafka monitor. It contains a lot of refactoring to streamline and simplify the code, as well as changes to how we interact with the KafkaConsumer API, now that I understand it a bit better.

Furthermore, this patch series contains the changes to seek_start (now seek_start_document) from #41, as well as a feature imported from sophys-live-view, seek_back_in_time with the hour_offset parameter in the monitor. My intention here is to have a robust and generic implementation for these utilities, so we can share code between sophys-common, sophys-live-view, and maybe others in the future.

I've spent quite some effort in the automated tests, so that we could trust those implementation changes. I would suggest looking at them when reviewing to maybe get a better understanding of what the code is supposed to be doing!

Supersedes #41

flowln added 10 commits March 12, 2026 12:53
Signed-off-by: Sofia Donato Ferreira <sofia.ferreira@lnls.br>
It seems like development has picked up again in the original
kafka-python project, and some good bug fixes are in on the
newest versions. Thus, we can switch our dependency.

Signed-off-by: Sofia Donato Ferreira <sofia.ferreira@lnls.br>
Now the seeking will work on any document type, including the
'stop' document, which previously wouldn't work at all.

The function was moved out of the class for ease of testing,
in the next commit of this patchset.

Signed-off-by: Sofia Donato Ferreira <sofia.ferreira@lnls.br>
Signed-off-by: Sofia Donato Ferreira <sofia.ferreira@lnls.br>
Signed-off-by: Sofia Donato Ferreira <sofia.ferreira@lnls.br>
Signed-off-by: Sofia Donato Ferreira <sofia.ferreira@lnls.br>
Signed-off-by: Sofia Donato Ferreira <sofia.ferreira@lnls.br>
Signed-off-by: Sofia Donato Ferreira <sofia.ferreira@lnls.br>
Signed-off-by: Sofia Donato Ferreira <sofia.ferreira@lnls.br>
Signed-off-by: Sofia Donato Ferreira <sofia.ferreira@lnls.br>
@flowln flowln requested a review from Igort4 March 12, 2026 20:52
@flowln flowln added bug Something isn't working enhancement New feature development or request labels Mar 12, 2026
Signed-off-by: Sofia Donato Ferreira <sofia.ferreira@lnls.br>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature development or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant