mirror of https://github.com/apache/cloudstack.git
Merge release branch 4.9 to master
* 4.9: CLOUDSTACK-9071: Properly parse stats.output.uri in StatsCollector
This commit is contained in:
commit
ad0c25fbc4
|
|
@ -40,6 +40,7 @@ import org.apache.cloudstack.outofbandmanagement.OutOfBandManagementVO;
|
|||
import org.apache.cloudstack.outofbandmanagement.dao.OutOfBandManagementDao;
|
||||
import org.apache.cloudstack.utils.identity.ManagementServerNode;
|
||||
import org.apache.cloudstack.utils.usage.UsageUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
|
||||
|
|
@ -285,12 +286,18 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
|
|||
s_logger.info(scheme + " is not a valid protocol for external statistics. No statistics will be send.");
|
||||
}
|
||||
|
||||
externalStatsHost = uri.getHost();
|
||||
if (!StringUtils.isEmpty(uri.getHost())) {
|
||||
externalStatsHost = uri.getHost();
|
||||
}
|
||||
|
||||
externalStatsPort = uri.getPort();
|
||||
externalStatsPrefix = uri.getPath().substring(1);
|
||||
|
||||
if (!StringUtils.isEmpty(uri.getPath())) {
|
||||
externalStatsPrefix = uri.getPath().substring(1);
|
||||
}
|
||||
|
||||
/* Append a dot (.) to the prefix if it is set */
|
||||
if (externalStatsPrefix != null && !externalStatsPrefix.equals("")) {
|
||||
if (!StringUtils.isEmpty(externalStatsPrefix)) {
|
||||
externalStatsPrefix += ".";
|
||||
} else {
|
||||
externalStatsPrefix = "";
|
||||
|
|
|
|||
Loading…
Reference in New Issue