Refine
This commit is contained in:
@@ -1313,19 +1313,19 @@ if __name__ == "__main__":
|
|||||||
# step1: 检查连接状态,初始化influxdb的buckets
|
# step1: 检查连接状态,初始化influxdb的buckets
|
||||||
# try:
|
# try:
|
||||||
# # delete_buckets(client, org_name)
|
# # delete_buckets(client, org_name)
|
||||||
create_and_initialize_buckets(client, org_name)
|
# create_and_initialize_buckets(client, org_name)
|
||||||
# except Exception as e:
|
# except Exception as e:
|
||||||
# print(f"连接失败: {e}")
|
# print(f"连接失败: {e}")
|
||||||
# finally:
|
# finally:
|
||||||
# client.close()
|
# client.close()
|
||||||
|
|
||||||
# step2: 先查询pg数据库中scada_info的信息,然后存储SCADA数据到SCADA_data这个bucket里
|
# step2: 先查询pg数据库中scada_info的信息,然后存储SCADA数据到SCADA_data这个bucket里
|
||||||
##query_pg_scada_info_realtime('bb')
|
query_pg_scada_info_realtime('bb')
|
||||||
##query_pg_scada_info_non_realtime('bb')
|
query_pg_scada_info_non_realtime('bb')
|
||||||
|
|
||||||
# 手动执行
|
# 手动执行
|
||||||
# store_realtime_SCADA_data_to_influxdb(get_real_value_time='2025-02-07T16:52:00+08:00')
|
# store_realtime_SCADA_data_to_influxdb(get_real_value_time='2025-02-07T16:52:00+08:00')
|
||||||
##store_non_realtime_SCADA_data_to_influxdb(get_history_data_end_time='2025-02-08T12:00:00+08:00')
|
store_non_realtime_SCADA_data_to_influxdb(get_history_data_end_time='2025-02-08T12:00:00+08:00')
|
||||||
|
|
||||||
# step3: 查询测试示例
|
# step3: 查询测试示例
|
||||||
# with InfluxDBClient(url=url, token=token, org=org_name) as client:
|
# with InfluxDBClient(url=url, token=token, org=org_name) as client:
|
||||||
|
|||||||
Reference in New Issue
Block a user