From 28bba9f5e60c4bf1d5bfa5dff497557aa697bbdf Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Fri, 12 Aug 2011 13:47:38 +0000 Subject: [PATCH] More verbose warning message --- lib/request/connect.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/request/connect.py b/lib/request/connect.py index 7016c265d..01b9d9b69 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -576,12 +576,16 @@ class Connect: while len(kb.responseTimes) < MIN_TIME_RESPONSES: Connect.queryPage(content=True) - if stdev(kb.responseTimes) > WARN_TIME_STDEV: + deviation = stdev(kb.responseTimes) + + if deviation > WARN_TIME_STDEV: kb.adjustTimeDelay = False - warnMsg = "there is considerable lagging in connection " - warnMsg += "response(s). Please use as high value for " - warnMsg += "--time-sec option as possible (e.g. 10 or more)" + warnMsg = "there is considerable lagging (standard deviation: " + warnMsg += "%f sec%s) " % (deviation, "s" if deviation > 1 else "") + warnMsg += "in connection response(s). Please use as high " + warnMsg += "value for --time-sec option as possible (e.g. " + warnMsg += "%d or more)" % (conf.timeSec * 2) logger.critical(warnMsg) elif not kb.testMode: warnMsg = "it is very important not to stress the network adapter's "