Minor fine tuning

This commit is contained in:
Miroslav Stampar 2013-01-29 21:06:02 +01:00
parent f41460f8d8
commit bd08ede117
2 changed files with 5 additions and 1 deletions

View File

@ -100,6 +100,7 @@ from lib.core.settings import IS_WIN
from lib.core.settings import LARGE_OUTPUT_THRESHOLD from lib.core.settings import LARGE_OUTPUT_THRESHOLD
from lib.core.settings import MIN_ENCODED_LEN_CHECK from lib.core.settings import MIN_ENCODED_LEN_CHECK
from lib.core.settings import MIN_TIME_RESPONSES from lib.core.settings import MIN_TIME_RESPONSES
from lib.core.settings import MIN_VALID_DELAYED_RESPONSE
from lib.core.settings import ML from lib.core.settings import ML
from lib.core.settings import NULL from lib.core.settings import NULL
from lib.core.settings import PARAMETER_AMP_MARKER from lib.core.settings import PARAMETER_AMP_MARKER
@ -1913,7 +1914,7 @@ def wasLastResponseDelayed():
logger.warn(warnMsg) logger.warn(warnMsg)
lowerStdLimit = average(kb.responseTimes) + TIME_STDEV_COEFF * deviation lowerStdLimit = average(kb.responseTimes) + TIME_STDEV_COEFF * deviation
retVal = (threadData.lastQueryDuration >= lowerStdLimit) retVal = (threadData.lastQueryDuration >= max(MIN_VALID_DELAYED_RESPONSE, lowerStdLimit))
if not kb.testMode and retVal: if not kb.testMode and retVal:
if kb.adjustTimeDelay is None: if kb.adjustTimeDelay is None:

View File

@ -64,6 +64,9 @@ CONCAT_VALUE_DELIMITER = '|'
# Coefficient used for a time-based query delay checking (must be >= 7) # Coefficient used for a time-based query delay checking (must be >= 7)
TIME_STDEV_COEFF = 7 TIME_STDEV_COEFF = 7
# Minimum response time that can be even considered as delayed (not a complete requirement)
MIN_VALID_DELAYED_RESPONSE = 0.5
# Standard deviation after which a warning message should be displayed about connection lags # Standard deviation after which a warning message should be displayed about connection lags
WARN_TIME_STDEV = 0.5 WARN_TIME_STDEV = 0.5