This commit is contained in:
caixiang 2022-07-29 10:38:43 +08:00
parent e7a542d386
commit 8a3a037bda
5 changed files with 8 additions and 8 deletions

View File

@ -78,7 +78,7 @@ public enum InfluxClient {
public void insert(Event event, String measurement){ public void insert(Event event, String measurement){
Point point = Point.measurement(measurement) Point point = Point.measurement(measurement)
.addTag("transationId", event.getTransationId()) .addTag("transationId", event.getTransationId())
.addTag("inspectionSheet", event.getInspectionSheet()) .addTag("inspectionSheetId", event.getInspectionSheetId())
.addTag("argName", event.getArgName()) .addTag("argName", event.getArgName())
.addField("argValue", event.getArgValue()) .addField("argValue", event.getArgValue())
.time(event.getTime().toEpochMilli(), WritePrecision.MS); .time(event.getTime().toEpochMilli(), WritePrecision.MS);
@ -93,7 +93,7 @@ public enum InfluxClient {
for(Event event:events){ for(Event event:events){
Point point = Point.measurement(measurement) Point point = Point.measurement(measurement)
.addTag("transationId", event.getTransationId()) .addTag("transationId", event.getTransationId())
.addTag("inspectionSheet", event.getInspectionSheet()) .addTag("inspectionSheetId", event.getInspectionSheetId())
.addTag("argName", event.getArgName()) .addTag("argName", event.getArgName())
.addField("argValue", event.getArgValue()) .addField("argValue", event.getArgValue())
.time(event.getTime().toEpochMilli(), WritePrecision.MS); .time(event.getTime().toEpochMilli(), WritePrecision.MS);

View File

@ -58,7 +58,7 @@ public class S7DemoController {
event.setTransationId("asas"+i); event.setTransationId("asas"+i);
event.setArgName("LTWeight"); event.setArgName("LTWeight");
Double d = r.nextDouble() * 2.5 + 66; Double d = r.nextDouble() * 2.5 + 66;
event.setInspectionSheet(j+""); event.setInspectionSheetId(j+"");
event.setArgValue(d); event.setArgValue(d);
list.add(event); list.add(event);
} }
@ -88,7 +88,7 @@ public class S7DemoController {
queryDataParam.setMeasurement("ASProcessCompleteEventAS"); queryDataParam.setMeasurement("ASProcessCompleteEventAS");
List<String> dropNames = new ArrayList<>(); List<String> dropNames = new ArrayList<>();
dropNames.add("transationId"); dropNames.add("transationId");
dropNames.add("inspectionSheet"); dropNames.add("inspectionSheetId");
queryDataParam.setDropedTagNames(dropNames); queryDataParam.setDropedTagNames(dropNames);
queryDataParam.setTag(new Tag("argName","arg6")); queryDataParam.setTag(new Tag("argName","arg6"));
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(10).toInstant(),Instant.now())); queryDataParam.setRange(new Range(DataUtils.getBeforeDate(10).toInstant(),Instant.now()));
@ -114,7 +114,7 @@ public class S7DemoController {
queryDataParam.setMeasurement("ASProcessCompleteEventAS"); queryDataParam.setMeasurement("ASProcessCompleteEventAS");
List<String> dropNames = new ArrayList<>(); List<String> dropNames = new ArrayList<>();
dropNames.add("transationId"); dropNames.add("transationId");
dropNames.add("inspectionSheet"); dropNames.add("inspectionSheetId");
queryDataParam.setDropedTagNames(dropNames); queryDataParam.setDropedTagNames(dropNames);
queryDataParam.setTag(new Tag("argName","arg7")); queryDataParam.setTag(new Tag("argName","arg7"));
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(10).toInstant(),Instant.now())); queryDataParam.setRange(new Range(DataUtils.getBeforeDate(10).toInstant(),Instant.now()));

View File

@ -17,7 +17,7 @@ public class Event {
private Instant time; private Instant time;
private String inspectionSheet; private String inspectionSheetId;
private String transationId; private String transationId;

View File

@ -103,7 +103,7 @@ public class MeanRGraph {
queryDataParam.setBucket(Constant.bucket); queryDataParam.setBucket(Constant.bucket);
List<String> dropNames = new ArrayList<>(); List<String> dropNames = new ArrayList<>();
dropNames.add("transationId"); dropNames.add("transationId");
dropNames.add("inspectionSheet"); dropNames.add("inspectionSheetId");
queryDataParam.setDropedTagNames(dropNames); queryDataParam.setDropedTagNames(dropNames);
queryDataParam.setTag(new Tag("argName",argName)); queryDataParam.setTag(new Tag("argName",argName));
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(10).toInstant(), Instant.now())); queryDataParam.setRange(new Range(DataUtils.getBeforeDate(10).toInstant(), Instant.now()));

View File

@ -100,7 +100,7 @@ public class MeanStandardDeviationGraph {
queryDataParam.setBucket(Constant.bucket); queryDataParam.setBucket(Constant.bucket);
List<String> dropNames = new ArrayList<>(); List<String> dropNames = new ArrayList<>();
dropNames.add("transationId"); dropNames.add("transationId");
dropNames.add("inspectionSheet"); dropNames.add("inspectionSheetId");
queryDataParam.setDropedTagNames(dropNames); queryDataParam.setDropedTagNames(dropNames);
queryDataParam.setTag(new Tag("argName",argName)); queryDataParam.setTag(new Tag("argName",argName));
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(10).toInstant(), Instant.now())); queryDataParam.setRange(new Range(DataUtils.getBeforeDate(10).toInstant(), Instant.now()));