mark
This commit is contained in:
parent
0dfff37b3d
commit
2cc12991b0
@ -76,12 +76,23 @@ public enum InfluxClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void insert(Event event, String measurement){
|
public void insert(Event event, String measurement){
|
||||||
Point point = Point.measurement(measurement)
|
Point point = null;
|
||||||
|
if(event.getBatchNum()==null){
|
||||||
|
point = Point.measurement(measurement)
|
||||||
.addTag("transationId", event.getTransationId())
|
.addTag("transationId", event.getTransationId())
|
||||||
.addTag("inspectionSheetId", event.getInspectionSheetId())
|
.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);
|
||||||
|
}else {
|
||||||
|
point = Point.measurement(measurement)
|
||||||
|
.addTag("transationId", event.getTransationId())
|
||||||
|
//.addTag("inspectionSheetId", event.getInspectionSheetId())
|
||||||
|
.addTag("batchNum", event.getBatchNum().toString())
|
||||||
|
.addTag("argName", event.getArgName())
|
||||||
|
.addField("argValue", event.getArgValue())
|
||||||
|
.time(event.getTime().toEpochMilli(), WritePrecision.MS);
|
||||||
|
}
|
||||||
writeApi.writePoint(point);
|
writeApi.writePoint(point);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -114,7 +125,7 @@ public enum InfluxClient {
|
|||||||
}else {
|
}else {
|
||||||
point = Point.measurement(measurement)
|
point = Point.measurement(measurement)
|
||||||
.addTag("transationId", event.getTransationId())
|
.addTag("transationId", event.getTransationId())
|
||||||
.addTag("inspectionSheetId", event.getInspectionSheetId())
|
//.addTag("inspectionSheetId", event.getInspectionSheetId())
|
||||||
.addTag("batchNum", event.getBatchNum().toString())
|
.addTag("batchNum", event.getBatchNum().toString())
|
||||||
.addTag("argName", event.getArgName())
|
.addTag("argName", event.getArgName())
|
||||||
.addField("argValue", event.getArgValue())
|
.addField("argValue", event.getArgValue())
|
||||||
|
@ -19,4 +19,10 @@ public class Event {
|
|||||||
private String argName;
|
private String argName;
|
||||||
|
|
||||||
private String argValue;
|
private String argValue;
|
||||||
|
|
||||||
|
private String BatchNum;
|
||||||
|
|
||||||
|
private String InspectionSheetId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user