mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
server: use latest InfluxDB (2.15), add support to Batch Mode (#3289)
The InfluxDB Java client supports Batch Mode at versions 2.9+ [1]. Thus, this PR updated to the latest InfluxDB (2.15), adding support to Batch Mode [1] https://github.com/influxdata/influxdb-java
This commit is contained in:
parent
89d548052b
commit
d6437d5aca
6
pom.xml
6
pom.xml
@ -130,6 +130,7 @@
|
||||
<cs.guava.version>23.6-jre</cs.guava.version>
|
||||
<cs.httpclient.version>4.5.4</cs.httpclient.version>
|
||||
<cs.httpcore.version>4.4.8</cs.httpcore.version>
|
||||
<cs.influxdb-java.version>2.15</cs.influxdb-java.version>
|
||||
<cs.jackson.version>2.9.2</cs.jackson.version>
|
||||
<cs.jasypt.version>1.9.2</cs.jasypt.version>
|
||||
<cs.java-ipv6.version>0.16</cs.java-ipv6.version>
|
||||
@ -524,6 +525,11 @@
|
||||
<artifactId>groovy-all</artifactId>
|
||||
<version>${cs.groovy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.influxdb</groupId>
|
||||
<artifactId>influxdb-java</artifactId>
|
||||
<version>${cs.influxdb-java.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jmx</artifactId>
|
||||
|
||||
@ -160,7 +160,6 @@
|
||||
<dependency>
|
||||
<groupId>org.influxdb</groupId>
|
||||
<artifactId>influxdb-java</artifactId>
|
||||
<version>2.8</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
|
||||
@ -51,6 +51,7 @@ import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.influxdb.BatchOptions;
|
||||
import org.influxdb.InfluxDB;
|
||||
import org.influxdb.InfluxDBFactory;
|
||||
import org.influxdb.dto.BatchPoints;
|
||||
@ -1502,6 +1503,7 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
|
||||
*/
|
||||
protected void writeBatches(InfluxDB influxDbConnection, String dbName, List<Point> points) {
|
||||
BatchPoints batchPoints = BatchPoints.database(dbName).build();
|
||||
influxDbConnection.enableBatch(BatchOptions.DEFAULTS);
|
||||
|
||||
for (Point point : points) {
|
||||
batchPoints.point(point);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user