diff options
Diffstat (limited to 'detection/tool')
| -rw-r--r-- | detection/tool/Functions.py | 28 | ||||
| -rw-r--r-- | detection/tool/__pycache__/Functions.cpython-39.pyc | bin | 10696 -> 0 bytes |
2 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())
diff --git a/detection/tool/__pycache__/Functions.cpython-39.pyc b/detection/tool/__pycache__/Functions.cpython-39.pyc Binary files differdeleted file mode 100644 index 1375d38..0000000 --- a/detection/tool/__pycache__/Functions.cpython-39.pyc +++ /dev/null |
