From 80faabf3dc4900a72f62a375b78a3a2a1f59a81b Mon Sep 17 00:00:00 2001 From: LuoYe Date: Tue, 17 Aug 2021 18:46:31 +0800 Subject: [PATCH] backup --- src/test/java/influxdb2Test.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/java/influxdb2Test.java b/src/test/java/influxdb2Test.java index 38e67c1..c777943 100644 --- a/src/test/java/influxdb2Test.java +++ b/src/test/java/influxdb2Test.java @@ -34,20 +34,20 @@ public class influxdb2Test { List list = new ArrayList<>(); for (int i = 0; i < 100; i++) { OutlookLog outlookLog = new OutlookLog(); - outlookLog.setResult(0).setMsg(i + "- ok").setOriginalMsg("加入成功").setCallTime(Instant.now()); + outlookLog.setResult(1).setMsg(i + "- ok").setOriginalMsg("加入成功").setCallTime(Instant.now()); list.add(outlookLog); } - OutlookLog outlookLog = new OutlookLog(); - outlookLog.setResult(0).setMsg(i + "- ok").setOriginalMsg("加入成功").setCallTime(Instant.now()); - BeanMap.create(outlookLog).getBean(); + + BeanMap beanMap = BeanMap.create(list.get(0)); try (WriteApi writeApi = influxDBClient.getWriteApi(writeOptions)) { // writeApi.writeMeasurement(); // writeApi.writeMeasurements("e5", org ,WritePrecision.NS,list); Point point = Point .measurement("githubId_123") .addTag("githubId","123465") - .addFields(fields) + .addFields(beanMap) .time(Instant.now(), WritePrecision.NS); + writeApi.writePoint("e5",org,point); } influxDBClient.close();