You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2021/08/05 19:26:29 UTC

[GitHub] [gobblin] umustafi commented on a change in pull request #3351: [GOBBLIN-1505] Add metrics for WorkUnit count

umustafi commented on a change in pull request #3351:
URL: https://github.com/apache/gobblin/pull/3351#discussion_r683729121



##########
File path: gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinHelixJobLauncher.java
##########
@@ -205,6 +209,12 @@ protected void runWorkUnits(List<WorkUnit> workUnits) throws Exception {
       this.eventSubmitter.submit(countEventBuilder);
       LOGGER.info("Emitting WorkUnitsCreated Count: " + countEventBuilder.getCount());
 
+      MetricContext
+          metricContext = Instrumented.getMetricContext(ConfigUtils.configToState(ConfigFactory.empty()), getClass());
+      String workUnitCountName = MetricRegistry.name(this.jobContext.getJobState().getProp(ConfigurationKeys.FLOW_GROUP_KEY),
+          this.jobContext.getJobState().getProp(ConfigurationKeys.FLOW_NAME_KEY), "workunits");
+      metricContext.newContextAwareGauge(workUnitCountName, () -> workUnits.size());

Review comment:
       Yes thank you, registered the metric. Here is the [PR](https://github.com/apache/gobblin/commit/6bed94a0f213ef64b225bb05b80ab338c25bbc17) relating to the register requirement for future reference. 




-- 
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: dev-unsubscribe@gobblin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org