Preparing for producer diagnostics #1452
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It has been a long wish to have producer diagnostics. Although these are not really hard to add, the consumer diagnostics are a bit in the way; these already claim some names and make code sharing awkward. Now that we are moving towards zio-kafka 3.0 we can fix these at the cost of some backward incompatibilities.
This PR prepares for the introduction of producer diagnostics by moving the consumer diagnostics specific code out of the diagnostics package, while keeping the sharable code there.
The following changes are proposed (fixable with scalafix):
zio.kafka.consumer.diagnostics.Diagnostics
zio.kafka.consumer.Consumer.ConsumerDiagnostics
zio.kafka.consumer.diagnostics.Diagnostics.NoOp
zio.kafka.consumer.Consumer.NoDiagnostics
zio.kafka.consumer.diagnostics.DiagnosticEvent
zio.kafka.consumer.ConsumerDiagnosticEvent
zio.kafka.consumer.diagnostics.DiagnosticEvent.*
zio.kafka.consumer.ConsumerDiagnosticEvent.*
zio.kafka.consumer.diagnostics.DiagnosticEvent.Finalization.*
zio.kafka.consumer.ConsumerDiagnosticEvent.*
Move to internal or test package:
zio.kafka.consumer.diagnostics.Diagnostics.SligingQueue
zio.kafka.utils.SlidingDiagnostics[ConsumerDiagnostics]
zio.kafka.consumer.diagnostics.Diagnostics.ConcurrentDiagnostics
zio.kafka.diagnostics.internal.ConcurrentDiagnostics
zio.kafka.consumer.diagnostics.DiagnosticEvent.Finalization
Notes:
SligingQueue
public.DiagnosticEvent.Finalization
was removed from the type hierarchy because it doesn't serve any user purpose (it was introduced to make it easier to test the shutdown sequence of the consumer).