Refine msgpack usage for datetime
This commit is contained in:
@@ -1823,7 +1823,7 @@ def query_all_record_by_time_property(query_time: str, type: str, property: str,
|
||||
|
||||
|
||||
# 2025/02/21
|
||||
def query_all_record_by_date(query_date: str, bucket: str="realtime_simulation_result") -> tuple:
|
||||
def query_all_records_by_date(query_date: str, bucket: str="realtime_simulation_result") -> tuple:
|
||||
"""
|
||||
查询指定日期的所有记录,包括‘node’和‘link’,分别以指定的格式返回
|
||||
:param query_date: 输入的日期,格式为‘2025-02-14’
|
||||
@@ -1834,7 +1834,7 @@ def query_all_record_by_date(query_date: str, bucket: str="realtime_simulation_r
|
||||
|
||||
# 记录开始时间
|
||||
time_cost_start = time.perf_counter()
|
||||
print('{} -- query_all_record_by_date started.'.format(datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%Y-%m-%d %H:%M:%S')))
|
||||
print('{} -- query_all_records_by_date started.'.format(datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%Y-%m-%d %H:%M:%S')))
|
||||
|
||||
if not client.ping():
|
||||
print("{} -- Failed to connect to InfluxDB.".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S')))
|
||||
@@ -1895,7 +1895,7 @@ def query_all_record_by_date(query_date: str, bucket: str="realtime_simulation_r
|
||||
})
|
||||
|
||||
time_cost_end = time.perf_counter()
|
||||
print('{} -- query_all_record_by_date finished, cost time: {:.2f} s.'.format( datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%Y-%m-%d %H:%M:%S'), time_cost_end - time_cost_start))
|
||||
print('{} -- query_all_records_by_date finished, cost time: {:.2f} s.'.format( datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%Y-%m-%d %H:%M:%S'), time_cost_end - time_cost_start))
|
||||
|
||||
client.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user