本文整理了Java中org.apache.helix.monitoring.mbeans.ZkClientMonitor.getObjectName()
方法的一些代码示例,展示了ZkClientMonitor.getObjectName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkClientMonitor.getObjectName()
方法的具体详情如下:
包路径:org.apache.helix.monitoring.mbeans.ZkClientMonitor
类名称:ZkClientMonitor
方法名:getObjectName
暂无
代码示例来源:origin: apache/helix
private ObjectName buildObjectName(String tag, String key, String instance) throws MalformedObjectNameException {
return ZkClientMonitor.getObjectName(tag, key, instance);
}
代码示例来源:origin: apache/helix
public ZkClientPathMonitor register() throws JMException {
List<DynamicMetric<?, ?>> attributeList = new ArrayList<>();
attributeList.add(_readCounter);
attributeList.add(_writeCounter);
attributeList.add(_readBytesCounter);
attributeList.add(_writeBytesCounter);
attributeList.add(_readFailureCounter);
attributeList.add(_writeFailureCounter);
attributeList.add(_readTotalLatencyCounter);
attributeList.add(_writeTotalLatencyCounter);
attributeList.add(_readLatencyGauge);
attributeList.add(_writeLatencyGauge);
attributeList.add(_readBytesGauge);
attributeList.add(_writeBytesGauge);
ObjectName objectName = new ObjectName(String
.format("%s,%s=%s", ZkClientMonitor.getObjectName(_type, _key, _instanceName).toString(),
MONITOR_PATH, _path.name()));
doRegister(attributeList, ZkClientMonitor.MBEAN_DESCRIPTION, objectName);
return this;
}
代码示例来源:origin: org.apache.helix/helix-core
public ZkClientPathMonitor register() throws JMException {
List<DynamicMetric<?, ?>> attributeList = new ArrayList<>();
attributeList.add(_readCounter);
attributeList.add(_writeCounter);
attributeList.add(_readBytesCounter);
attributeList.add(_writeBytesCounter);
attributeList.add(_readFailureCounter);
attributeList.add(_writeFailureCounter);
attributeList.add(_readTotalLatencyCounter);
attributeList.add(_writeTotalLatencyCounter);
attributeList.add(_readLatencyGauge);
attributeList.add(_writeLatencyGauge);
attributeList.add(_readBytesGauge);
attributeList.add(_writeBytesGauge);
ObjectName objectName = new ObjectName(String.format("%s,%s=%s",
ZkClientMonitor.getObjectName(_type, _key, _instanceName).toString(),
MONITOR_PATH, _path.name()));
doRegister(attributeList, MBEAN_DESCRIPTION, objectName);
return this;
}
代码示例来源:origin: apache/helix
@Override
public DynamicMBeanProvider register() throws JMException {
List<DynamicMetric<?, ?>> attributeList = new ArrayList<>();
attributeList.add(_dataChangeEventCounter);
attributeList.add(_outstandingRequestGauge);
attributeList.add(_stateChangeEventCounter);
if (_zkEventThreadMetric != null) {
attributeList.add(_zkEventThreadMetric);
}
doRegister(attributeList, MBEAN_DESCRIPTION,
getObjectName(_monitorType, _monitorKey, _monitorInstanceName));
for (ZkClientPathMonitor.PredefinedPath path : ZkClientPathMonitor.PredefinedPath.values()) {
// If monitor root path only, check if the current path is Root.
// Otherwise, add monitors for every path.
if (!_monitorRootOnly || path.equals(ZkClientPathMonitor.PredefinedPath.Root)) {
_zkClientPathMonitorMap.put(path,
new ZkClientPathMonitor(path, _monitorType, _monitorKey, _monitorInstanceName)
.register());
}
}
return this;
}
代码示例来源:origin: org.apache.helix/helix-core
public ZkClientMonitor(String monitorType, String monitorKey, String monitorInstanceName,
boolean monitorRootPathOnly) throws JMException {
if (monitorKey == null || monitorKey.isEmpty() || monitorType == null || monitorType
.isEmpty()) {
throw new HelixException("Cannot create ZkClientMonitor without monitor key and type.");
}
_sensorName =
String.format("%s.%s.%s", MonitorDomainNames.HelixZkClient.name(), monitorType, monitorKey);
_objectName =
MBeanRegistrar.register(this, getObjectName(monitorType, monitorKey, monitorInstanceName));
for (ZkClientPathMonitor.PredefinedPath path : ZkClientPathMonitor.PredefinedPath.values()) {
// If monitor root path only, check if the current path is Root.
// Otherwise, add monitors for every path.
if (!monitorRootPathOnly || path.equals(ZkClientPathMonitor.PredefinedPath.Root)) {
_zkClientPathMonitorMap.put(path,
new ZkClientPathMonitor(path, monitorType, monitorKey, monitorInstanceName).register());
}
}
}
内容来源于网络,如有侵权,请联系作者删除!