2022-03-23 05:49:39 +01:00
# README #
2022-03-23 04:45:26 +00:00
2022-03-23 05:49:39 +01:00
This repo is meant to be a drop-in replacement for the [vendor-scheduler-service ](https://bitbucket.org/outfrontmedia/vendor-scheduler-service/src/master/ ) built in Ruby. It is part of the overall [programmatic design ](https://outfrontmedia.atlassian.net/wiki/spaces/OSP/pages/3008430113/Engineering+Design+for+Programmatic ) for ONEX.
2022-03-23 04:45:26 +00:00
2022-03-23 05:49:39 +01:00
## Dependencies
2022-03-23 04:45:26 +00:00
2022-03-23 05:49:39 +01:00
[RabbitMQ ](https://www.rabbitmq.com ) is used as the message queue for communication from and to ONEX.
For local development, you can use the Docker image by running this command:
2022-03-23 04:45:26 +00:00
2022-03-23 05:49:39 +01:00
```shell
docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3.9-management
2022-03-23 04:45:26 +00:00
```
2022-03-23 05:49:39 +01:00
After running, that you can access the management interface at http://localhost:15672 using the user name and password of `guest` .
2022-03-23 04:45:26 +00:00
2022-03-23 05:49:39 +01:00
## Benchmark process
2022-03-23 04:45:26 +00:00
2022-03-23 05:49:39 +01:00
> NOTE: Make sure `ulimit -n` is set appropriately. For example, if you expect to have 1000 concurrent connections, it should be higher than that.
2022-03-23 04:45:26 +00:00
2022-03-23 05:49:39 +01:00
`fake_server` is a simple web server that returns a JSON response in a randomized time of 200 - 800 milliseconds.
You can adjust that interval to experiment with different upstream API response times.
2022-03-23 04:45:26 +00:00
2022-03-23 05:49:39 +01:00
`go run fake_server/fake_server.go`
2022-03-23 04:45:26 +00:00
2022-03-23 05:49:39 +01:00
`fill_queue` will seed 15,000 simulated ONEX messages on the queue. You can adjust this number as needed
`ONEX_QUEUE_URL="amqp://guest:guest@localhost:5672/" go run fillqueue/main.go`
2022-03-23 04:45:26 +00:00
2022-03-23 05:49:39 +01:00
`main.go` pulls messages off the queue and makes a call to the fake server for each one.
You can tweak the number of queued messages and the maximum number of parallel HTTP connections.
`ONEX_QUEUE_URL="amqp://guest:guest@localhost:5672/" VISTAR_API_URL="http://localhost:8090" go run vendorscheduler/main.go`
2022-03-23 04:45:26 +00:00
2022-03-23 05:49:39 +01:00
* Database configuration
* How to run tests
* Load testing
* Deployment instructions