diff --git a/lib/core/common.py b/lib/core/common.py index f132a1ef9..eb8543e78 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -71,6 +71,7 @@ from lib.core.settings import DUMP_TAB_MARKER from lib.core.settings import DUMP_START_MARKER from lib.core.settings import DUMP_STOP_MARKER from lib.core.settings import MIN_TIME_RESPONSES +from lib.core.settings import TIME_STDEV_COEFF class UnicodeRawConfigParser(RawConfigParser): """ @@ -1595,7 +1596,7 @@ def wasLastRequestDelayed(): warnMsg += "with less than %d response times" % MIN_TIME_RESPONSES logger.warn(warnMsg) - return (threadData.lastQueryDuration >= average(kb.responseTimes) + 7 * deviation) + return (threadData.lastQueryDuration >= average(kb.responseTimes) + TIME_STDEV_COEFF * deviation) else: return threadData.lastQueryDuration - conf.timeSec diff --git a/lib/core/settings.py b/lib/core/settings.py index 67315e4f2..12f7ea9c6 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -49,7 +49,8 @@ DUMP_STOP_MARKER = "__STOP__" PAYLOAD_DELIMITER = "\x00" CHAR_INFERENCE_MARK = "%c" -UNKNOWN_DBMS_VERSION = "Unknown" +# coefficient used for a time-based query delay checking (must be >= 7) +TIME_STDEV_COEFF = 10 # suffix used for naming meta databases in DBMS(es) without explicit database name METADB_SUFFIX = "_masterdb" @@ -60,6 +61,9 @@ MIN_TIME_RESPONSES = 15 # after these number of blanks at the end inference should stop (just in case) INFERENCE_BLANK_BREAK = 10 +# string used for representation of unknown dbms version +UNKNOWN_DBMS_VERSION = "Unknown" + # System variables IS_WIN = subprocess.mswindows # The name of the operating system dependent module imported. The following