Source:
<code>private void refreshBaseline(ResourceControllerDataProvider clusterData, Map<HelixConstants.ChangeType, Set<String>> clusterChanges, Map<String, Resource> resourceMap, final CurrentStateOutput currentStateOutput) throws HelixRebalanceException { LOG.info("Start calculating the new baseline."); <START> _metricCollector.getMetric(WagedRebalancerMetricNames.GlobalStateReadLatencyGauge.name(), <END> LatencyMetric.class).startMeasuringLatency(); Map<String, ResourceAssignment> currentBaseline = getBaselineAssignment(_assignmentMetadataStore, currentStateOutput, resourceMap.keySet()); _metricCollector.getMetric(WagedRebalancerMetricNames.GlobalStateReadLatencyGauge.name(), LatencyMetric.class).endMeasuringLatency(); Map<String, ResourceAssignment> newBaseline = calculateAssignment(clusterData, clusterChanges, resourceMap, clusterData.getAllInstances(), Collections.emptyMap(), currentBaseline); _metricCollector.getMetric(WagedRebalancerMetricNames.GlobalStateWriteLatencyGauge.name(), LatencyMetric.class).startMeasuringLatency(); if (_assignmentMetadataStore != null) { try { _assignmentMetadataStore.persistBaseline(newBaseline); } catch (Exception ex) { throw new HelixRebalanceException("Failed to persist the new baseline assignment.", HelixRebalanceException.Type.INVALID_REBALANCER_STATUS, ex); } } else { LOG.debug("Assignment Metadata Store is empty. Skip persist the baseline assignment."); } _metricCollector.getMetric(WagedRebalancerMetricNames.GlobalStateWriteLatencyGauge.name(), LatencyMetric.class).endMeasuringLatency(); LOG.info("Finish calculating the new baseline."); }</code><technical_language>here, please push detailed private method if possible</technical_language>

Target:
private void refreshBaseline(ResourceControllerDataProvider clusterData, Map<HelixConstants.ChangeType, Set<String>> clusterChanges, Map<String, Resource> resourceMap, final CurrentStateOutput currentStateOutput) throws HelixRebalanceException { LOG.info("Start calculating the new baseline."); LatencyMetric globalBaselineCalcLatency = _metricCollector.getMetric( WagedRebalancerMetricCollector.WagedRebalancerMetricNames.GlobalBaselineCalcLatencyGauge .name(), LatencyMetric.class); globalBaselineCalcLatency.startMeasuringLatency(); Map<String, ResourceAssignment> currentBaseline = getBaselineAssignment(_assignmentMetadataStore, currentStateOutput, resourceMap.keySet()); Map<String, ResourceAssignment> newBaseline = calculateAssignment(clusterData, clusterChanges, resourceMap, clusterData.getAllInstances(), Collections.emptyMap(), currentBaseline); if (_assignmentMetadataStore != null) { try { LatencyMetric writeLatency = _metricCollector.getMetric( WagedRebalancerMetricCollector.WagedRebalancerMetricNames.StateWriteLatencyGauge.name(), LatencyMetric.class); writeLatency.startMeasuringLatency(); _assignmentMetadataStore.persistBaseline(newBaseline); writeLatency.endMeasuringLatency(); } catch (Exception ex) { throw new HelixRebalanceException("Failed to persist the new baseline assignment.", HelixRebalanceException.Type.INVALID_REBALANCER_STATUS, ex); } } else { LOG.debug("Assignment Metadata Store is empty. Skip persist the baseline assignment."); } globalBaselineCalcLatency.endMeasuringLatency(); LOG.info("Finish calculating the new baseline."); }