- Scala - programming language
- Play framework - MVC
- H2 - in-memory SQL db
- Redis - NOSQL key-value store
- Slick - ORM for RDBMS
- Akka - actor model for websocket handle
- Bootstrap3 - for UI design
- Jquery - for UI scripting
- Sbt - build system
- build.sbt - project build configuration
- application.conf - main configuration file
- routes - controllers paths
- 1.sql - init SQL script
- app - source folder
- client.html - test client with random image loading
- Installed java 8* jdk (I use java version "1.8.0_45")
- Installed sbt launcher version 0.13.* (I use 0.13.8)
- Run Redis Server 3.0.3 on standard port (6379)
- Move to project directory and execute:
sbt run
- Open browser and navigate:
http://localhost:9000/
Important! Second operation will take some time. Sbt will compile and run project.
- Download typesafe activator
- Move to project directory and execute:
activator -jvm-debug 9999 run
- Install intellij idea 14+
- Install scala plugin > 1.5
- Open project by build.sbt file
- Call Refresh All sbt projects at the sbt window
- In project directory run
sbt clean coverage test
- After open in browser $PATH_TO_PROJECT/banner-roulette/target/scala-2.11/scoverage-report/index.html
Command: ab -n 10000 -c 20 http://localhost:9000/api/random
Result: Percentage of the requests served within a certain time (ms)
50% 15
66% 18
75% 20
80% 21
90% 26
95% 30
98% 36
99% 40
100% 73 (longest request)
Command: ab -n 100000 -c 20 http://localhost:9000/api/random
Result: Percentage of the requests served within a certain time (ms)
50% 9
66% 11
75% 13
80% 14
90% 18
95% 22
98% 27
99% 31
100% 78 (longest request)