New API for updating history data of VODs
Methods | Url | body | Description |
---|---|---|---|
POST | /histories/add | {"object_id":"5243a","user_id":21801629,"episode_num": 5,"elapsed_time": 27} |
add history of vod |
GET | /histories/list/<user_id> | Get list vod save in redis | |
GET | /histories/<user_id>/<vod_id> | Get vod history info |
In Windows, maybe you get error with Hyper-V when use: > docker-machine create -d hyperv dev
. To fix it just Add your current user to "Local Group": 'Hyper-V Administrators'.
Check your <current username> by:
> whoami
Start cmd.exe
by Administrator:
- Check localgroup by:
> net localgroup
- Add to Hyper-V Admininstrators:
> net localgroup "Hyper-V Administrators" <current username> /add
- Sign out or Reboot
- docker-machine
- docker-ce
- docker-composer
Use docker-machine in Windows add current user to Hyper-V ``
-
install new docker virtual machine:
$: docker-machine create -d vitualbox fplay
-
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run:
$: docker-machine env fplay
-
Run this command to configure your shell:
$: eval $(docker-machine env fplay)
-
Build Docker-composer:
$: docker-compose build
-
Run:
$: docker-compose up --build
-
Get Ip Docker machine is running:
docker-machine ip fplay
-
Go to this ip get from step 6, exp: http://192.168.99.100
-
Run redis-cli:
docker-compose run rcli
-
make post request in wrk test add new histories vod, with name
post.lua
:wrk.method = "POST" wrk.body ='{"object_id":"5243a507c9692811f221a","user_id":21801629,"episode_num":5,"elapsed_time":27}' wrk.headers["Content-Type"] = "application/json"
-
Test load:
wrk -t4 -c500000 -d30s -s path/to/post.lua http://192.168.99.100/histories/add