You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by hu...@apache.org on 2019/10/23 02:54:13 UTC
[helix] branch master updated: Add back the original
DataPropagationLatencyGuage (with a typo) and mark it deprecated (#517)
This is an automated email from the ASF dual-hosted git repository.
hulee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git
The following commit(s) were added to refs/heads/master by this push:
new aad78eb Add back the original DataPropagationLatencyGuage (with a typo) and mark it deprecated (#517)
aad78eb is described below
commit aad78ebd6a261cda11b049fe69a05cd89a47f007
Author: Huizhi L <ih...@gmail.com>
AuthorDate: Tue Oct 22 19:54:05 2019 -0700
Add back the original DataPropagationLatencyGuage (with a typo) and mark it deprecated (#517)
If we remove the name with a typo, DataPropagationLatencyGuage, current metrics graph may not see the old metric and historical DataPropagationLatencyGuage data might get lost. To support backward compatibility, adding back DataPropagationLatencyGuage and mark it as deprecated.
---
.../monitoring/mbeans/ZkClientPathMonitor.java | 26 ++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ZkClientPathMonitor.java b/helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ZkClientPathMonitor.java
index 4094d14..76edf56 100644
--- a/helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ZkClientPathMonitor.java
+++ b/helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ZkClientPathMonitor.java
@@ -77,9 +77,15 @@ public class ZkClientPathMonitor extends DynamicMBeanProvider {
ReadBytesGauge,
WriteBytesGauge,
/*
- * The latency between a ZK data change happening in the server side and the client side getting notification.
+ * The latency between a ZK data change happening on the server side and the client side.
*/
- DataPropagationLatencyGauge
+ DataPropagationLatencyGauge,
+ /**
+ * @deprecated
+ * This domain name has a typo. Keep it in case its historical metric data is being used.
+ */
+ @Deprecated
+ DataPropagationLatencyGuage
}
private SimpleDynamicMetric<Long> _readCounter;
@@ -97,6 +103,13 @@ public class ZkClientPathMonitor extends DynamicMBeanProvider {
private HistogramDynamicMetric _writeBytesGauge;
private HistogramDynamicMetric _dataPropagationLatencyGauge;
+ /**
+ * @deprecated
+ * Keep it for backward-compatibility purpose.
+ */
+ @Deprecated
+ private HistogramDynamicMetric _dataPropagationLatencyGuage;
+
@Override
public String getSensorName() {
return _sensorName;
@@ -143,6 +156,12 @@ public class ZkClientPathMonitor extends DynamicMBeanProvider {
new HistogramDynamicMetric(PredefinedMetricDomains.DataPropagationLatencyGauge.name(),
new Histogram(new SlidingTimeWindowArrayReservoir(getResetIntervalInMs(),
TimeUnit.MILLISECONDS)));
+
+ // This is deprecated and keep it for backward-compatibility purpose.
+ _dataPropagationLatencyGuage =
+ new HistogramDynamicMetric(PredefinedMetricDomains.DataPropagationLatencyGuage.name(),
+ new Histogram(new SlidingTimeWindowArrayReservoir(getResetIntervalInMs(),
+ TimeUnit.MILLISECONDS)));
}
public ZkClientPathMonitor register() throws JMException {
@@ -160,6 +179,8 @@ public class ZkClientPathMonitor extends DynamicMBeanProvider {
attributeList.add(_readBytesGauge);
attributeList.add(_writeBytesGauge);
attributeList.add(_dataPropagationLatencyGauge);
+ // This is deprecated and keep it for backward-compatibility purpose.
+ attributeList.add(_dataPropagationLatencyGuage);
ObjectName objectName = new ObjectName(String
.format("%s,%s=%s", ZkClientMonitor.getObjectName(_type, _key, _instanceName).toString(),
@@ -184,6 +205,7 @@ public class ZkClientPathMonitor extends DynamicMBeanProvider {
public void recordDataPropagationLatency(long latency) {
_dataPropagationLatencyGauge.updateValue(latency);
+ _dataPropagationLatencyGuage.updateValue(latency);
}
private void increaseFailureCounter(boolean isRead) {