String topologyId = workerData.getTopologyId();
String hostName =JStormServerUtils.getHostName(workerData.getConf());
String workerId = hostName + ":" + workerData.getPort();
UserDefMetric userDefMetric = Metrics.getUserDefMetric();
UserDefMetricData userDefMetricData = new UserDefMetricData();
userDefMetricData.updateFromGauge(userDefMetric.getGauge());
userDefMetricData.updateFromCounter(userDefMetric.getCounter());
userDefMetricData.updateFromMeterData(userDefMetric.getMeter());
// If metrics performance is disable, Timer & Histogram metrics will not be monitored,
// and the corresponding metrics data will not be sent to ZK either.
if (metricPerf == false) {
userDefMetricData.updateFromHistogramData(userDefMetric.getHistogram());
userDefMetricData.updateFromTimerData(userDefMetric.getTimer());
}
try {
clusterState.update_userDef_metric(topologyId, workerId, userDefMetricData);
} catch(Exception e) {