updog/extensions/checkers/checker_template/checker_template.py

15 lines
No EOL
365 B
Python

import random
class CheckerTemplate:
def __init__(arguments):
pass
def get_status():
latency = int(random.random() * 3000)
if latency > 2500: # "simulate" a timeout
return 0
elif latency > 1000: # "simulate" a very slow application - a partial outage
return 50
else:
return 100