| Magul added a comment. |
I've developed simple script, that request wikichristian and create simple statistics, how often it is failing.
Source of script:
from datetime import datetime from datetime import timedelta
from pywikibot.site_detect import MWSite
attempt_counter = 0
fail_counter = 0
max_successive_fail_counter = 0
max_outage = timedelta()
curr_successive_fail_counter = 0
curr_outage = timedelta()
global_start = datetime.now()
outage_start = None
while True:
try:
try:
attempt_counter += 1
_ = MWSite('http://www.wikichristian.org/index.php?title=$1')
except RuntimeError:
if curr_successive_fail_counter == 0:
outage_start = datetime.now()
fail_counter += 1
curr_successive_fail_counter += 1
else:
if curr_successive_fail_counter > 0:
curr_outage = datetime.now() - outage_start
max_outage = max(max_outage, curr_outage)
max_successive_fail_counter = max(max_successive_fail_counter,
curr_successive_fail_counter)
curr_successive_fail_counter = 0
except KeyboardInterrupt:
break
global_stop = datetime.now()
print('''
Start testing at: {}
End testing at: {}
Testing time: {}
Longest outage: {}
Maximum successive fails: {}
'''.format(global_start,
global_stop,
global_stop - global_start,
max_outage,
max_successive_fail_counter))I'm starting running it now. We will see, what can we do here.
TASK DETAIL
EMAIL PREFERENCES
To: Magul
Cc: pywikibot-bugs-list, Aklapper, Magul, Tbscho, MayS, Mdupont, JJMC89, jayvdb, Dalba, Masti, Alchimista, Rxy
Cc: pywikibot-bugs-list, Aklapper, Magul, Tbscho, MayS, Mdupont, JJMC89, jayvdb, Dalba, Masti, Alchimista, Rxy
_______________________________________________ pywikibot-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs
