Provides tip for adjusting time delay in time-based data retrieval
(lastQueryDuration, lowerStdLimit)
| 2831 | return delta >= 0 |
| 2832 | |
| 2833 | def adjustTimeDelay(lastQueryDuration, lowerStdLimit): |
| 2834 | """ |
| 2835 | Provides tip for adjusting time delay in time-based data retrieval |
| 2836 | """ |
| 2837 | |
| 2838 | candidate = (1 if not isHeavyQueryBased() else 2) + int(round(lowerStdLimit)) |
| 2839 | |
| 2840 | kb.delayCandidates = [candidate] + kb.delayCandidates[:-1] |
| 2841 | |
| 2842 | if all((_ == candidate for _ in kb.delayCandidates)) and candidate < conf.timeSec: |
| 2843 | if lastQueryDuration / (1.0 * conf.timeSec / candidate) > MIN_VALID_DELAYED_RESPONSE: # Note: to prevent problems with fast responses for heavy-queries like RANDOMBLOB |
| 2844 | conf.timeSec = candidate |
| 2845 | |
| 2846 | infoMsg = "adjusting time delay to " |
| 2847 | infoMsg += "%d second%s due to good response times" % (conf.timeSec, 's' if conf.timeSec > 1 else '') |
| 2848 | logger.info(infoMsg) |
| 2849 | |
| 2850 | def getLastRequestHTTPError(): |
| 2851 | """ |
no test coverage detected
searching dependent graphs…