Skip to content

Latest commit

 

History

History
108 lines (73 loc) · 2.5 KB

File metadata and controls

108 lines (73 loc) · 2.5 KB

Technology stack

Project overview

  • 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

Running

Prerequisites

  1. Installed java 8* jdk (I use java version "1.8.0_45")
  2. Installed sbt launcher version 0.13.* (I use 0.13.8)
  3. Run Redis Server 3.0.3 on standard port (6379)

Build & Deploy

  1. Move to project directory and execute:
sbt run
  1. Open browser and navigate:
http://localhost:9000/

Important! Second operation will take some time. Sbt will compile and run project.

Run in debug mode

  1. Download typesafe activator
  2. Move to project directory and execute:
activator -jvm-debug 9999 run

Open project in intellij idea

  1. Install intellij idea 14+
  2. Install scala plugin > 1.5
  3. Open project by build.sbt file
  4. Call Refresh All sbt projects at the sbt window

Testing

Execute unit tests with coverage

  1. In project directory run
sbt clean coverage test
  1. After open in browser $PATH_TO_PROJECT/banner-roulette/target/scala-2.11/scoverage-report/index.html

Benchmarking

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)