方法引入调整
This commit is contained in:
@@ -61,7 +61,7 @@ public class DataTest {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
InfluxDbUtils influxDBUtil = new InfluxDbUtils("admin", "123456", "http://192.168.1.18:8086", "pqsbase_sjzx", "");
|
||||
InfluxDbUtils influxDBUtil = new InfluxDbUtils("root", "123456", "http://127.0.0.1:8086", "pqsadmin_jb", "");
|
||||
|
||||
insert(influxDBUtil);
|
||||
}
|
||||
@@ -72,16 +72,88 @@ public class DataTest {
|
||||
|
||||
//单条数据插入
|
||||
public static void insert(InfluxDbUtils influxDBUtil) {
|
||||
|
||||
// Map<String, String> tags = new HashMap<>();
|
||||
// long time = Long.parseLong("1719921600000");
|
||||
// tags.put("line_id", "82a9bad93e784c37135db4589794e6b0");
|
||||
// tags.put("phasic_type", "A");
|
||||
// tags.put("value_type","CP95");
|
||||
// tags.put("quality_flag","0");
|
||||
//
|
||||
// Map<String, Object> fields = new HashMap<>();
|
||||
// fields.put("i_2",0);
|
||||
// fields.put("i_3",0);
|
||||
// fields.put("i_4",0);
|
||||
// fields.put("i_5",6.02);
|
||||
// fields.put("i_6",0);
|
||||
// fields.put("i_7",0);
|
||||
// fields.put("i_8",0);
|
||||
// fields.put("i_9",0);
|
||||
// fields.put("i_10",0);
|
||||
// fields.put("i_11",0);
|
||||
// fields.put("i_12",0);
|
||||
// fields.put("i_13",0);
|
||||
// fields.put("i_14",0);
|
||||
// fields.put("i_15",3.25);
|
||||
// fields.put("i_16",0);
|
||||
// fields.put("i_17",0);
|
||||
// fields.put("i_18",0);
|
||||
// fields.put("i_19",0);
|
||||
// fields.put("i_20",0);
|
||||
// fields.put("i_21",0);
|
||||
// fields.put("i_22",0);
|
||||
// fields.put("i_23",0);
|
||||
// fields.put("i_24",3.52);
|
||||
// fields.put("i_25",0);
|
||||
// influxDBUtil.insert("data_i", tags, fields, time, TimeUnit.MILLISECONDS);
|
||||
|
||||
Map<String, String> tags = new HashMap<>();
|
||||
long time = Long.parseLong("1675958400000");
|
||||
tags.put("dev_id", "57d121d45a26f3cc1d7b6ba541f895c0");
|
||||
long time = Long.parseLong("1719842400000");
|
||||
tags.put("line_id", "ebdf6cbc275c5d7ed8104fcb3792fb0a");
|
||||
tags.put("phasic_type", "A");
|
||||
tags.put("value_type","CP95");
|
||||
tags.put("quality_flag","0");
|
||||
|
||||
Map<String, Object> fields = new HashMap<>();
|
||||
fields.put("v_1",10.0);
|
||||
fields.put("v_2",0);
|
||||
fields.put("v_3",0);
|
||||
fields.put("v_4",0);
|
||||
fields.put("v_5",6.02);
|
||||
fields.put("v_6",0);
|
||||
fields.put("v_7",0);
|
||||
fields.put("v_8",0);
|
||||
fields.put("v_9",0);
|
||||
fields.put("v_10",0);
|
||||
fields.put("v_11",0);
|
||||
fields.put("v_12",0);
|
||||
fields.put("v_13",0);
|
||||
fields.put("v_14",0);
|
||||
fields.put("v_15",3.25);
|
||||
fields.put("v_16",0);
|
||||
fields.put("v_17",0);
|
||||
fields.put("v_18",0);
|
||||
fields.put("v_19",0);
|
||||
fields.put("v_20",0);
|
||||
fields.put("v_21",0);
|
||||
fields.put("v_22",0);
|
||||
fields.put("v_23",0);
|
||||
fields.put("v_24",3.52);
|
||||
fields.put("v_25",0);
|
||||
influxDBUtil.insert("data_inharm_v", tags, fields, time, TimeUnit.MILLISECONDS);
|
||||
|
||||
|
||||
|
||||
// Map<String, String> tags = new HashMap<>();
|
||||
// long time = Long.parseLong("1675958400000");
|
||||
// tags.put("dev_id", "57d121d45a26f3cc1d7b6ba541f895c0");
|
||||
// Map<String, Object> fields = new HashMap<>();
|
||||
// fields.put("due",1440);
|
||||
// fields.put("real",1200);
|
||||
fields.put("online_min", 0);
|
||||
fields.put("offline_min", 1440);
|
||||
fields.put("online_rate", 0.0000);
|
||||
influxDBUtil.insert("pqs_onlinerate", tags, fields, time, TimeUnit.MILLISECONDS);
|
||||
// fields.put("online_min", 0);
|
||||
// fields.put("offline_min", 1440);
|
||||
// fields.put("online_rate", 0.0000);
|
||||
// influxDBUtil.insert("pqs_onlinerate", tags, fields, time, TimeUnit.MILLISECONDS);
|
||||
// long time = Long.parseLong("1655135328135");
|
||||
// Map<String, String> tags = new HashMap<>();
|
||||
// // tags.put("line_id", "127fad1dcb0077ac2979141b8473a5e4");
|
||||
|
||||
Reference in New Issue
Block a user