allthingssecurity commented on code in PR #27464:
URL: https://github.com/apache/camel/pull/27464#discussion_r4204263736


##########
core/camel-management/src/main/java/org/apache/camel/management/InstrumentationInterceptStrategy.java:
##########
@@ -33,13 +33,26 @@
  */
 public class InstrumentationInterceptStrategy implements 
ManagementInterceptStrategy {
 
+    /**
+     * A processor that has been wrapped for performance counters.
+     *
+     * @param definition               the definition the processor was 
created from, which can be shared by several
+     *                                 routes (such as the outputs of a 
context scoped onException)
+     * @param instrumentationProcessor the processor that wraps it
+     * @param route                    the route the processor belongs to
+     */
+    public record WrappedProcessor(NamedNode definition, 
InstrumentationProcessor<?> instrumentationProcessor, Route route) {
+    }
+
     private final Map<NamedNode, PerformanceCounter> registeredCounters;
-    private final Map<Processor, KeyValueHolder<NamedNode, 
InstrumentationProcessor<?>>> wrappedProcessors;
+    private final Map<Processor, WrappedProcessor> wrappedProcessors;
+    private final Route route;
 
     public InstrumentationInterceptStrategy(Map<NamedNode, PerformanceCounter> 
registeredCounters,

Review Comment:
   Thanks @davsclaus, done in 8ce2536c060e:
   - the 4.23 upgrade guide (camel-management section) now says that the public 
constructor of `InstrumentationInterceptStrategy` takes `WrappedProcessor` map 
values and the `Route`, which must not be `null`;
   - the constructor now checks the route with `ObjectHelper.notNull(route, 
"route")`, and the new `InstrumentationInterceptStrategyTest` covers a `null` 
route.
   
   camel-management (`org.apache.camel.management` tests, built with `-am`): 
420 tests, 0 failures.
   
   The new paragraph and the one of #27462 are both at the end of the 
camel-management section, so whichever PR is merged second needs a small 
rebase. I will do it.
   
   _Claude Code on behalf of allthingssecurity_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to