def api_outage_fix(): set_outage(False) control = get_control() emit('control', control, namespace='/app', broadcast=True) return success(get_state())
def api_set_data_frequency(): frequency = request.args.get('frequency', 1) set_data_frequency(frequency) control = get_control() emit('control', control, namespace='/app', broadcast=True) return success(get_state())
def api_set_clock_skew(): skew = request.args.get('skew', 1) set_clock_skew(skew) control = get_control() emit('control', control, namespace='/app', broadcast=True) return success(get_state())
def api_outage_strategy(): strategy = request.args.get('strategy', 'immediate') set_outage_strategy(strategy) control = get_control() emit('control', control, namespace='/app', broadcast=True) return success(get_state())
def sockect_connect(): increment_connection_count() increment_requests_per_second() state = get_state() emit('state', state, namespace='/presentation', broadcast=True) control = get_control() emit('control', control, namespace='/app', broadcast=True)
def api_state(): state = get_state() return success(state)
def api_reset_max_requests(): reset_max_requests_per_second() state = get_state() return success(state)
def api_reset_counter(): reset_all() state = get_state() return success(state)
def hello(): state = get_state() return render_template('index.html', state=state)
def socket_disconnect(): decrement_connection_count() state = get_state() emit('state', state, namespace='/presentation', broadcast=True)