mark for pull
This commit is contained in:
@@ -2,7 +2,7 @@ package com.cnbm.influx;
|
||||
|
||||
import com.cnbm.influx.config.InfluxClient;
|
||||
import com.cnbm.influx.param.QueryDataParam;
|
||||
import com.cnbm.influx.common.Utils;
|
||||
|
||||
import com.cnbm.influx.param.PageInfo;
|
||||
import com.cnbm.influx.param.Range;
|
||||
import com.cnbm.influx.param.Tag;
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/influx")
|
||||
@@ -29,17 +30,20 @@ public class S7DemoController {
|
||||
@PostMapping("/insertBatch")
|
||||
public void insertBatch() throws InterruptedException {
|
||||
List<Event> list = new ArrayList<>();
|
||||
Random r = new Random();
|
||||
|
||||
for(int i=0;i<99;i++){
|
||||
Thread.sleep(100);
|
||||
|
||||
for(int i=0;i<999;i++){
|
||||
Thread.sleep(10);
|
||||
Event event = new Event();
|
||||
event.setTime(Instant.now());
|
||||
event.setTransationId("asas"+i);
|
||||
event.setArgName("arg7");
|
||||
event.setArgValue(new Double(i));
|
||||
event.setArgName("LTWeight");
|
||||
Double d = r.nextDouble() * 2.5 + 66;
|
||||
event.setArgValue(d);
|
||||
list.add(event);
|
||||
}
|
||||
InfluxClient.Client.batchInsert(list,"ASProcessCompleteEventAS");
|
||||
InfluxClient.Client.batchInsert(list,"Weight");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user