[GitHub] [incubator-gobblin] sv2000 commented on a change in pull request #2891: [GOBBLIN-1051] Emit Helix Leader Metrics
sv2000 commented on a change in pull request #2891: [GOBBLIN-1051] Emit Helix Leader Metrics URL: https://github.com/apache/incubator-gobblin/pull/2891#discussion_r380895329 ## File path: gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GobblinServiceManager.java ## @@ -214,6 +223,14 @@ public GobblinServiceManager(String serviceName, String serviceId, Config config this.isGitConfigMonitorEnabled = false; } +// Initialize Helix leader guage +helixLeaderGauges = Optional.of(new HelixLeaderState()); +String helixLeaderStateGaugeName = +MetricRegistry.name(MetricReportUtils.GOBBLIN_SERVICE_METRICS_PREFIX, ServiceMetricNames.HELIX_LEADER_STATE); +ContextAwareGauge gauge = metricContext.newContextAwareGauge(helixLeaderStateGaugeName, () -> helixLeaderGauges.get().state.value); Review comment: Use helixLeaderGauges.get().state.getValue() with Getter on value field? 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-gobblin] sv2000 commented on a change in pull request #2891: [GOBBLIN-1051] Emit Helix Leader Metrics
sv2000 commented on a change in pull request #2891: [GOBBLIN-1051] Emit Helix Leader Metrics URL: https://github.com/apache/incubator-gobblin/pull/2891#discussion_r380895014 ## File path: gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GobblinServiceManager.java ## @@ -645,4 +678,21 @@ private static void testGobblinService(GobblinServiceManager gobblinServiceManag throw new RuntimeException(e); } } + + @Setter + private static class HelixLeaderState { +private LeaderState state = LeaderState.UNKNOWN; + } + + private enum LeaderState { +UNKNOWN(-1), +SLAVE(0), +MASTER(1); + +public int value; Review comment: Annotate with @Getter? 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-gobblin] sv2000 commented on a change in pull request #2891: [GOBBLIN-1051] Emit Helix Leader Metrics
sv2000 commented on a change in pull request #2891: [GOBBLIN-1051] Emit Helix Leader Metrics URL: https://github.com/apache/incubator-gobblin/pull/2891#discussion_r380894548 ## File path: gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GobblinServiceManager.java ## @@ -25,6 +28,9 @@ import java.util.Properties; import java.util.concurrent.TimeUnit; +import org.slf4j.Logger; Review comment: Are these unused imports? Don't see them being used in this PR? 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services