mirror of
https://github.com/luoye663/e5.git
synced 2024-12-25 11:18:50 +00:00
backup
This commit is contained in:
parent
cfeab18dd0
commit
80faabf3dc
@ -34,20 +34,20 @@ public class influxdb2Test {
|
|||||||
List<OutlookLog> list = new ArrayList<>();
|
List<OutlookLog> list = new ArrayList<>();
|
||||||
for (int i = 0; i < 100; i++) {
|
for (int i = 0; i < 100; i++) {
|
||||||
OutlookLog outlookLog = new OutlookLog();
|
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);
|
list.add(outlookLog);
|
||||||
}
|
}
|
||||||
OutlookLog outlookLog = new OutlookLog();
|
|
||||||
outlookLog.setResult(0).setMsg(i + "- ok").setOriginalMsg("加入成功").setCallTime(Instant.now());
|
BeanMap beanMap = BeanMap.create(list.get(0));
|
||||||
BeanMap.create(outlookLog).getBean();
|
|
||||||
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
|
Point point = Point
|
||||||
.measurement("githubId_123")
|
.measurement("githubId_123")
|
||||||
.addTag("githubId","123465")
|
.addTag("githubId","123465")
|
||||||
.addFields(fields)
|
.addFields(beanMap)
|
||||||
.time(Instant.now(), WritePrecision.NS);
|
.time(Instant.now(), WritePrecision.NS);
|
||||||
|
writeApi.writePoint("e5",org,point);
|
||||||
|
|
||||||
}
|
}
|
||||||
influxDBClient.close();
|
influxDBClient.close();
|
||||||
|
Loading…
Reference in New Issue
Block a user