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