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

Add withMetrics1 method for partial binary compatibility #372

Merged
merged 2 commits into from
Aug 24, 2023

Conversation

Z1kkurat
Copy link
Contributor

@Z1kkurat Z1kkurat commented Aug 24, 2023

Motivation:
In an intermediate version 15.2.0 there were two methods for creating a metered producer:

  • a deprecated withMetrics using MeasureDuration from smetrics
  • withMetrics1 using MeasureDuration from cats-helper

There's only one withMetrics method now, using MeasureDuration from cats-helper.

The same goes for consumer: https://github.com/evolution-gaming/skafka/blob/v15.2.0/skafka/src/main/scala/com/evolutiongaming/skafka/consumer/Consumer.scala#L955-L969

If library A depends on v15.2.0 and calls withMetrics1(catshelper.MeasureDuration), and library B depends on A but evicts skafka to 16.0.0, then B calls A, A calls withMetrics1(catshelper.MeasureDuration), but there's no such method in skafka v16.0.0 (the only one present is withMetrics(catshelper.MeasureDuration)), so it fails with a runtime error.

This PR tries to fix that, at least partially.

@coveralls
Copy link

coveralls commented Aug 24, 2023

Pull Request Test Coverage Report for Build 5963567666

  • 0 of 2 (0.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.09%) to 76.841%

Changes Missing Coverage Covered Lines Changed/Added Lines %
skafka/src/main/scala/com/evolutiongaming/skafka/consumer/Consumer.scala 0 1 0.0%
skafka/src/main/scala/com/evolutiongaming/skafka/producer/Producer.scala 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
skafka/src/main/scala/com/evolutiongaming/skafka/consumer/ConsumerMetrics.scala 1 95.65%
Totals Coverage Status
Change from base Build 5544489927: -0.09%
Covered Lines: 1367
Relevant Lines: 1779

💛 - Coveralls

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

Successfully merging this pull request may close these issues.

3 participants