Пример #1
0
Файл: web.py Проект: d1on/locust
def swarm():
    assert request.method == "POST"
    from core import locust_runner

    locust_count = int(request.form["locust_count"])
    hatch_rate = float(request.form["hatch_rate"])
    locust_runner.start_hatching(locust_count, hatch_rate)
    response = make_response(json.dumps({'success':True, 'message': 'Swarming started'}))
    response.headers["Content-type"] = "application/json"
    return response
Пример #2
0
def swarm():
    assert request.method == "POST"
    from core import locust_runner

    locust_count = int(request.form["locust_count"])
    hatch_rate = float(request.form["hatch_rate"])
    locust_runner.start_hatching(locust_count, hatch_rate)
    response = make_response(
        json.dumps({
            'success': True,
            'message': 'Swarming started'
        }))
    response.headers["Content-type"] = "application/json"
    return response
Пример #3
0
def swarm():
    from core import locust_runner
    locust_runner.start_hatching()
    return json.dumps({'message': 'Swarming started'})