|
|
@@ -76,11 +76,14 @@ public class InfluxDbUtil {
|
|
|
, String.format("开始批量写入InfluxDb,数据量:%d", points.size()));
|
|
|
long begin = System.currentTimeMillis();
|
|
|
|
|
|
+ //转批量对象
|
|
|
+ Point[] array = points.parallelStream().toArray(Point[]::new);
|
|
|
+
|
|
|
+ //写入
|
|
|
for (InfluxDbClient influxDb : influxDBClients.clients()) {
|
|
|
- //转批量对象
|
|
|
BatchPoints batchPoints = BatchPoints
|
|
|
.database(influxDb.getDatabase())
|
|
|
- .points(points.toArray(new Point[0]))
|
|
|
+ .points(array)
|
|
|
.build();
|
|
|
|
|
|
influxDb.write(batchPoints);
|