Esempio n. 1
0
File: web.py Progetto: 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
Esempio n. 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
Esempio n. 3
0
File: web.py Progetto: Jahaja/locust
def swarm():
    from core import locust_runner
    locust_runner.start_hatching()
    return json.dumps({'message': 'Swarming started'})