phet commented on code in PR #3841:
URL: https://github.com/apache/gobblin/pull/3841#discussion_r1417735708
##########
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/DagActionStoreChangeMonitor.java:
##########
@@ -313,10 +300,28 @@ protected void createMetrics() {
this.nullDagActionTypeMessagesMeter =
this.getMetricContext().contextAwareMeter(RuntimeMetrics.GOBBLIN_DAG_ACTION_STORE_MONITOR_NULL_DAG_ACTION_TYPE_MESSAGES);
this.produceToConsumeDelayMillis =
this.getMetricContext().newContextAwareGauge(RuntimeMetrics.GOBBLIN_DAG_ACTION_STORE_PRODUCE_TO_CONSUME_DELAY_MILLIS,
() -> produceToConsumeDelayValue);
this.getMetricContext().register(this.produceToConsumeDelayMillis);
+
+ // Setup proxy for launch submission metrics
+ this.ON_STARTUP = new
LaunchSubmissionMetricProxy(this.successfulLaunchSubmissionsOnStartup,
this.failedLaunchSubmissionsOnStartup);
+ this.POST_STARTUP = new
LaunchSubmissionMetricProxy(this.successfulLaunchSubmissions,
this.failedLaunchSubmissions);
Review Comment:
the other alternative is to use the Null/NoOp Pattern in the call site, e.g.:
```
protected void submitFlow(DagAction dagAction, boolean isStartup) {
submitFlow(dagAction, (isStartup ? ON_STARTUP : POST_STARTUP).orElse(new
LaunchSubmissionMetricProxy { /* as in above comment */}));
}
```
i.e. make these two `volatile Optional<LSMP>`
--
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]