Skip to content

Conversation

@eschizoid
Copy link
Owner

No description provided.

@codecov
Copy link

codecov bot commented Sep 7, 2025

Codecov Report

❌ Patch coverage is 10.71429% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.20%. Comparing base (b95b786) to head (d277e96).

Files with missing lines Patch % Lines
...in/java/org/kpipe/metrics/SinkMetricsReporter.java 0.00% 25 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main      #62      +/-   ##
============================================
- Coverage     77.62%   76.20%   -1.43%     
  Complexity      351      351              
============================================
  Files            21       22       +1     
  Lines          1426     1437      +11     
  Branches        141      143       +2     
============================================
- Hits           1107     1095      -12     
- Misses          232      255      +23     
  Partials         87       87              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eschizoid eschizoid requested a review from Copilot September 9, 2025 11:39

This comment was marked as outdated.

@eschizoid eschizoid requested a review from Copilot September 9, 2025 11:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds metrics for sinks by introducing a new SinkMetricsReporter class and refactors existing classes to use record declarations for improved code structure.

  • Creates a new SinkMetricsReporter class for monitoring sink performance
  • Converts five classes from traditional class declarations to record declarations
  • Integrates the new sink metrics reporter into the main application

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
SinkMetricsReporter.java New comprehensive metrics reporter for sinks with flexible composition patterns
JsonConsoleSink.java Converted from class to record declaration
AvroConsoleSink.java Converted from class to record declaration
ProcessorMetricsReporter.java Converted from class to record declaration
ConsumerMetricsReporter.java Converted from class to record declaration
RebalanceListener.java Converted from class to record declaration
App.java Integrated new sink metrics reporter into the application

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

*/
public class JsonConsoleSink<K, V> implements MessageSink<K, V> {

public record JsonConsoleSink<K, V>(Logger logger, Level logLevel) implements MessageSink<K, V> {
Copy link

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The record's constructor parameters use Logger and Level without the fully qualified System.Logger and System.Logger.Level types that were used in the original constructor. This creates an ambiguity since multiple Logger and Level types exist in the Java ecosystem.

Suggested change
public record JsonConsoleSink<K, V>(Logger logger, Level logLevel) implements MessageSink<K, V> {
public record JsonConsoleSink<K, V>(java.lang.System.Logger logger, java.lang.System.Logger.Level logLevel) implements MessageSink<K, V> {

Copilot uses AI. Check for mistakes.
*/
public class AvroConsoleSink<K, V> implements MessageSink<K, V> {

public record AvroConsoleSink<K, V>(Logger logger, Level logLevel) implements MessageSink<K, V> {
Copy link

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The record's constructor parameters use Logger and Level without the fully qualified System.Logger and System.Logger.Level types that were used in the original constructor. This creates an ambiguity since multiple Logger and Level types exist in the Java ecosystem.

Suggested change
public record AvroConsoleSink<K, V>(Logger logger, Level logLevel) implements MessageSink<K, V> {
public record AvroConsoleSink<K, V>(java.lang.System.Logger logger, java.lang.System.Logger.Level logLevel) implements MessageSink<K, V> {

Copilot uses AI. Check for mistakes.
Comment on lines 64 to 66
/**
* Creates a processor metrics reporter with the specified registry and default logging.
*
Copy link

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The constructor documentation references parameters that no longer exist in the record declaration. The record constructor now has different parameters (processorNamesSupplier, metricsFetcher, reporter) than what the documentation describes.

Copilot uses AI. Check for mistakes.
Comment on lines 71 to 73
/**
* Creates a consumer metrics reporter with the specified metrics supplier and reporter.
*
Copy link

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The constructor documentation references parameters that no longer exist in the record declaration. The record constructor now has different parameters (metricsSupplier, uptimeSupplier, reporter) than what the documentation describes.

Copilot uses AI. Check for mistakes.
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.

2 participants