GabrielBrascher commented on a change in pull request #3078: Add influxdb to
statscollector
URL: https://github.com/apache/cloudstack/pull/3078#discussion_r239611614
##########
File path: server/src/main/java/com/cloud/server/StatsCollector.java
##########
@@ -411,7 +461,42 @@ private void init(Map<String, String> configs) {
}
- class HostCollector extends ManagedContextRunnable {
+ /**
+ * Configures the database name according to the URI path. For instance,
if the URI is as influxdb://address:port/dbname, the database name will be
'dbname'.
+ */
+ protected String configureDatabaseName(URI uri) {
+ String dbname = StringUtils.removeStart(uri.getPath(), "/");
+ if (StringUtils.isBlank(dbname)) {
+ return DEFAULT_DATABASE_NAME;
+ } else {
+ return dbname;
+ }
+ }
+
+ /**
+ * Configures the port to be used when connecting with the stats collector
service.
+ * Default values are 8086 for influx DB and 2003 for GraphiteDB.
+ * Throws URISyntaxException in case of non configured port and external
StatsType
+ */
+ protected int configureExternalStatsPort(URI uri) throws
URISyntaxException {
Review comment:
Good catch, the name might mislead. I will update to
`retrieveExternalStatsPortFromUri`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services