This repository has been archived by the owner on Jul 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c030658
commit 84840c7
Showing
2 changed files
with
31 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
## R API DEMO | ||
|
||
Investigate API Development with R - [plumber](https://github.com/trestletech/plumber), [Rserve](https://www.rforge.net/Rserve/) and [rApache](http://rapache.net/). | ||
|
||
### Docker | ||
|
||
``` | ||
## build | ||
docker build -t=api ./api/. | ||
## run | ||
# rApache - 7000, Rserve - 8000, plumber - 9000 | ||
# all APIs managed by supervisor | ||
docker run -d -p 7000:80 -p 8000:8000 -p 9000:9000 --name api api:latest | ||
``` | ||
|
||
### CURL | ||
|
||
``` | ||
# change port accordingly | ||
curl -H "Content-Type: application/json" -X POST -d '{"n": 10, "wait": 0.5}' http://localhost:7000/test | ||
``` | ||
|
||
### Performance Test | ||
|
||
``` | ||
## locust - only available for Python 2 | ||
# pip install locustio | ||
locust -f ./locustfile.py --host http://localhost:7000 --no-web -c 1 -r 1 | ||
``` |