pvillard31 commented on code in PR #10813:
URL: https://github.com/apache/nifi/pull/10813#discussion_r2738876223
##########
nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/repository/RepositoryContext.java:
##########
@@ -61,6 +62,8 @@ public interface RepositoryContext {
void adjustCounter(String name, long delta);
+ void recordGauge(GaugeRecord gaugeRecord);
+
Review Comment:
What about also adding
```suggestion
ComponentMetricContext getComponentMetricContext();
```
Then
````java
// In AbstractRepositoryContext.java, add:
@Override
public ComponentMetricContext getComponentMetricContext() {
return componentMetricContext;
}
````
Then you could remove
````java
// in StandardProcessSession.java:
private final ComponentMetricContext componentMetricContext;
// in StandardProcessSession constructor:
final Connectable connectable = context.getConnectable();
final Map<String, String> groupAttributes =
connectable.getProcessGroup().getLoggingAttributes();
componentMetricContext = new
ComponentMetricContext(connectable.getIdentifier(), connectable.getName(),
connectable.getComponentType(), groupAttributes);
````
and in `recordGauge()` method, use
````java
final GaugeRecord gaugeRecord = new GaugeRecord(name, value, recorded,
context.getComponentMetricContext());
````
Thoughts?
--
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]