narendly commented on a change in pull request #1056:
URL: https://github.com/apache/helix/pull/1056#discussion_r435555826
##########
File path:
helix-core/src/main/java/org/apache/helix/monitoring/mbeans/JobMonitor.java
##########
@@ -182,6 +198,59 @@ public void updateControllerInducedDelayGauge(long delay) {
_controllerInducedDelayGauge.updateValue(delay);
}
+ /**
+ * Sync the current SubmissionToProcessDelay mean to ZooKeeper
+ * @param baseDataAccessor
+ */
+ public void syncSubmissionToProcessDelayToZk(BaseDataAccessor<ZNRecord>
baseDataAccessor) {
+ syncMetricMeanValueToZk(baseDataAccessor,
+ JobMonitorMetricZnodeField.SUBMISSION_TO_PROCESS_DELAY,
_submissionToProcessDelayGauge);
+ }
+
+ /**
+ * Sync the current SubmissionToScheduleDelay mean to ZooKeeper
+ * @param baseDataAccessor
+ */
+ public void syncSubmissionToScheduleDelayToZk(BaseDataAccessor<ZNRecord>
baseDataAccessor) {
+ syncMetricMeanValueToZk(baseDataAccessor,
+ JobMonitorMetricZnodeField.SUBMISSION_TO_SCHEDULE_DELAY,
_submissionToScheduleDelayGauge);
+ }
+
+ /**
+ * Sync the current ControllerInducedDelay mean to ZooKeeper
+ * @param baseDataAccessor
+ */
+ public void syncControllerInducedDelayToZk(BaseDataAccessor<ZNRecord>
baseDataAccessor) {
+ syncMetricMeanValueToZk(baseDataAccessor,
+ JobMonitorMetricZnodeField.CONTROLLER_INDUCED_PROCESS_DELAY,
_controllerInducedDelayGauge);
+ }
+
+ private void syncMetricMeanValueToZk(BaseDataAccessor<ZNRecord>
baseDataAccessor,
+ JobMonitorMetricZnodeField field, HistogramDynamicMetric metric) {
+ String zkPath = buildZkPathForJobMonitorMetric(_jobType);
+
+ if (!baseDataAccessor.update(zkPath, currentData -> {
Review comment:
Is there a reason we're doing an update instead of set?
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]