summaryrefslogtreecommitdiff
path: root/detection/tool/Functions.py
diff options
context:
space:
mode:
author尹姜谊 <[email protected]>2024-01-17 10:58:28 +0800
committer尹姜谊 <[email protected]>2024-01-17 10:58:28 +0800
commit7325ca49bbcc2f87c35e8cbef26655ac41e445af (patch)
tree779b4098b84a3096c65c260a1043ae4c4bb04eae /detection/tool/Functions.py
parent102608e3325bf18d532956c2742a86e75ad85af7 (diff)
Modified:.gitignore配置修改
Diffstat (limited to 'detection/tool/Functions.py')
-rw-r--r--detection/tool/Functions.py28
1 files changed, 0 insertions, 28 deletions
diff --git a/detection/tool/Functions.py b/detection/tool/Functions.py
index 043be6b..abcee51 100644
--- a/detection/tool/Functions.py
+++ b/detection/tool/Functions.py
@@ -394,34 +394,6 @@ class connectTest():
port=config['port'], database=config['database'])
self.dbname = config['database']
- def dataTest(self):
- """
- :return: 0:no data 2:wrong configuration
- """
- # 测试数据库有无数据
- try:
- # testSQL = "select * from " + self.tableName + " where (toDateTime(common_recv_time) >= '" + str(
- # self.headTime) + "') and (toDateTime(common_recv_time) <='" + str(self.tailTime) + "') Limit 1"
-
- testSQL = "select * from " + self.tableName + " where common_recv_time >= toDateTime('" \
- + str(self.headTime) + "', '" + self.timeZone + "') and common_recv_time < toDateTime('" \
- + str(self.tailTime) + "', '" + self.timeZone + "') limit 1 "
-
- queryResult = self.client.execute(testSQL)
-
- if len(queryResult) < 1:
- # logger.error(datetime.datetime.now(tz=pytz.timezone(self.timeZone)).strftime(
- # "%Y-%m-%d %H:%M:%S") + '-' + str(self.headTime) + '~' + str(
- # self.tailTime) + ' dataTest: ' + str('No data in this time window'))
- return 0
- return 1
- except:
- return 2
- # logger.error(datetime.datetime.now(tz=pytz.timezone(self.timeZone)).strftime(
- # "%Y-%m-%d %H:%M:%S") + '-' + 'time: ' + str(self.headTime) + '~' + str(
- # self.tailTime) + ' dataTest: ' + str(
- # 'please check database configuration in config.yaml'))
-
def get_project_path():
path = os.path.join(os.getcwd())