Giter VIP home page Giter VIP logo

dispatch-windows-poc's Introduction

README

To run the POC:

  1. rails db:reset db:migrate
  2. redis-server
  3. bundle exec rake dispatch_window_channels_monitor:run
  4. rails s

To create order:

curl -X POST \ http://localhost:3000/api/orders

To pick an order:

replace the order id in the request body
curl -X POST \ http://localhost:3000/api/drivers/pick \ -H 'Content-Type: application/json' \ -d '{ "order_id": "69bac661-75d0-4cf1-991d-c0e8dc41910d" }'

To flush redis:

curl -X POST \ http://localhost:3000/api/utils/flush_redis

Locust Load Test

  1. install locust here
  2. pip install polling
  3. cd to #{PROJECT_ROOT}/load_test/locust
  4. locust -f locustfile.py UserLocust DriverLocust
  5. go to http://127.0.0.1:8089/ for locust dashboard
  6. start test from dashboard

load test configurations

#{PROJECT_ROOT}/load_test/locust/locustfile.py Test special configs:

  • DRIVER_POLL_INTERVAL:
    how frequent a driver checks the order list

Locust configs:

  • host:
    The host

  • min_wait & max_wait:
    In addition to the task_set attribute, one usually wants to declare the min_wait and max_wait attributes. These are the minimum and maximum time respectively, in milliseconds, that a simulated user will wait between executing each task. min_wait and max_wait default to 1000, and therefore a locust will always wait 1 second between each task if min_wait and max_wait are not declared.

  • weight: You can run two locusts from the same file like so:

    locust -f locust_file.py WebUserLocust MobileUserLocust If you wish to make one of these locusts execute more often you can set a weight attribute on those classes. Say for example, web users are three times more likely than mobile users:

   class WebUserLocust(Locust):
        weight = 3
        ....
    
   class MobileUserLocust(Locust):
        weight = 1
        ....

dispatch-windows-poc's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.