-
Notifications
You must be signed in to change notification settings - Fork 167
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
GH-241 Support changing metrics-level for KclMessageDrivenChannelAdapter #242
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution.
Any chances that you can modify KclMessageDrivenChannelAdapterTests
to verify this new option?
/** | ||
* Specify a metrics level to emit (DETAILED; default). | ||
* @param metricsLevel {@link MetricsLevel} DETAILED for emitting all metrics. | ||
* @author Minkyu Moon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move your author name to the class level.
@@ -267,6 +271,15 @@ public void setFanOut(boolean fanOut) { | |||
this.fanOut = fanOut; | |||
} | |||
|
|||
/** | |||
* Specify a metrics level to emit (DETAILED; default). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Specify a metrics level to emit (DETAILED; default). | |
* Specify a metrics level to emit. | |
* Defaults to {@link MetricsLevel#DETAILED}. |
@@ -267,6 +271,15 @@ public void setFanOut(boolean fanOut) { | |||
this.fanOut = fanOut; | |||
} | |||
|
|||
/** | |||
* Specify a metrics level to emit (DETAILED; default). | |||
* @param metricsLevel {@link MetricsLevel} DETAILED for emitting all metrics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param metricsLevel {@link MetricsLevel} DETAILED for emitting all metrics. | |
* @param metricsLevel the {@link MetricsLevel} for emitting (or not) metrics into Cloud Watch. |
...java/org/springframework/integration/aws/inbound/kinesis/KclMessageDrivenChannelAdapter.java
Show resolved
Hide resolved
@@ -321,13 +334,18 @@ protected void doStart() { | |||
.glueSchemaRegistryDeserializer(this.glueSchemaRegistryDeserializer) | |||
.retrievalSpecificConfig(retrievalSpecificConfig); | |||
|
|||
MetricsConfig metricsConfig = this.config.metricsConfig(); | |||
if(this.metricsLevel != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need in this if
since this.metricsLevel
cannot be null
.
...java/org/springframework/integration/aws/inbound/kinesis/KclMessageDrivenChannelAdapter.java
Show resolved
Hide resolved
…rivenChannelAdapter
Please, consider to modify a test. |
Thank you for your suggestion for my first contribution. |
Well, it is not this project responsibility.
and compare it with whatever we provide in the |
Thank you for your suggestion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And your name to that modified test class.
@@ -130,6 +150,7 @@ public KclMessageDrivenChannelAdapter kclMessageDrivenChannelAdapter() { | |||
adapter.setConverter(String::new); | |||
adapter.setConsumerGroup("single_stream_group"); | |||
adapter.setFanOut(false); | |||
adapter.setMetricsLevel(MetricsLevel.fromName("NONE")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is just enough to use MetricsLevel.NONE
.
"scheduler.metricsFactory.metricsLevel", | ||
MetricsLevel.class | ||
); | ||
MetricsLevel expectedMetricsLevel = TestUtils.getPropertyValue( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to do this. There is just enough to compare with the MetricsLevel.NONE
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, but no we have a Checkstyle violations:
Error: eckstyle] [ERROR] /home/runner/work/spring-integration-aws/spring-integration-aws/src/test/java/org/springframework/integration/aws/kinesis/KclMessageDrivenChannelAdapterTests.java:24:1: 'org.springframework.integration.test.util.TestUtils' should be separated from previous imports. [ImportOrder]
Error: eckstyle] [ERROR] /home/runner/work/spring-integration-aws/spring-integration-aws/src/test/java/org/springframework/integration/aws/kinesis/KclMessageDrivenChannelAdapterTests.java:25:1: Wrong order for 'software.amazon.awssdk.core.SdkBytes' import. [ImportOrder]
> Task :checkstyleTest
Error: eckstyle] [ERROR] /home/runner/work/spring-integration-aws/spring-integration-aws/src/test/java/org/springframework/integration/aws/kinesis/KclMessageDrivenChannelAdapterTests.java:46:1: Wrong order for 'software.amazon.kinesis.metrics.MetricsLevel' import. [ImportOrder]
Error: eckstyle] [ERROR] /home/runner/work/spring-integration-aws/spring-integration-aws/src/test/java/org/springframework/integration/aws/kinesis/KclMessageDrivenChannelAdapterTests.java:128:25: Reference to instance variable 'kclMessageDrivenChannelAdapter' needs "this.". [RequireThis]
Please, run locally gradlew check
to see all of the with recommendations how to fix.
I'm sorry to bother you. I checked Github Actions job, and fixed failure. |
Thank you for contribution; looking forward for more! |
Linked issue: #241