This commit is contained in:
LuoYe 2021-08-18 09:55:36 +08:00
parent 80faabf3dc
commit bfba053599

View File

@ -42,12 +42,17 @@ public class influxdb2Test {
try (WriteApi writeApi = influxDBClient.getWriteApi(writeOptions)) { try (WriteApi writeApi = influxDBClient.getWriteApi(writeOptions)) {
// writeApi.writeMeasurement(); // writeApi.writeMeasurement();
// writeApi.writeMeasurements("e5", org ,WritePrecision.NS,list); // writeApi.writeMeasurements("e5", org ,WritePrecision.NS,list);
Point point = Point List<Point> list1 = new ArrayList<>();
.measurement("githubId_123") for (int i = 0; i < 100; i++) {
.addTag("githubId","123465") Point point = Point
.addFields(beanMap) .measurement("githubId_123")
.time(Instant.now(), WritePrecision.NS); .addTag("githubId","123465")
writeApi.writePoint("e5",org,point); .addFields(beanMap)
.time(Instant.now(), WritePrecision.NS);
list1.add(point);
}
writeApi.writePoints("e5",org,list1);
} }
influxDBClient.close(); influxDBClient.close();