Code Monkey home page Code Monkey logo

roulette-api's Introduction

roulette-api

Technologies

Language used for developmment: Kotlin

Project testing technology: JUnit 5

Load tesing technology: JMeter

Endpoints

This Spring Boot application is built as an API endpoint for roulette applicaiton. There are 4 endpoints in total. They are as following:

/roulette/setVersion

Functionality: Used for setting a roulette version inside the session

Parameters: version(String): US_VERSION or EU_VERSION

Returns: Current value for saved version in session

/roulette/getVersion

Functionality: Used for getting the current roulette version saved in session. If no saved value found then, EU_VERSION will be set as default

Returns: Current value for saved version in session

/roulette/outsideBet

Functionality: Used for running a outside bet

Parameters:

amount (Double) : e.g. 100.00,

outsideBets(String): type of outside bet. Any of the following:

  • FIRST_DOZEN
  • SECOND_DOZEN
  • THIRD_DOZEN
  • LOW
  • HIGH
  • EVEN
  • ODD
  • BLACK
  • RED
  • FIRST_COLUMN
  • SECOND_COLUMN
  • THIRD_COLUMN

Returns: A Winning object: e.g: { "winner": true, "winningAmount": 0 }

/roulette/insideBet

Functionality: Used for running a inside bet

Parameters:

amount (Double) : e.g. 100.00,

insideBets(String): type of inside bet. Any of the following:

  • SINGLE
  • SPLIT
  • STREET
  • SQUARE
  • DOUBLE_STREET
  • TRIO
  • BASKET

numbers(Array of String): [5,8]

Returns: A Winning object: e.g: { "winner": true, "winningAmount": 0 }

The bets for current version are considered to be running in single mood. If multiple bates are being made, the front end can call the endpoints multiple time. But in that case the winning amount will have to be calculated in the front end, which should not be desired. This is a scope of improvement.

## Linux commands and explanations

Running the application

gradle bootRun

This command will run the application on http://localhost:8181

Running the test

gradle test

This command will run the JUnit test and a xml test log will be generated inside build/test-results/test/ directory

Running the Load Testing

gradle jmRun

This command will run the JMeter load test. The load test runs an inside bet and an outside bet through the system. A JMeter log gets generated in build/jmeter-report/ directory

There are two jmx files available inside src/test/jmeter/ directory. The preset JMeter files have a longer assertion time set. If the load testing is done from the JMeter source application, it takes less time than doing that through command line. To test using short assertion time, the value needs to be changed inside the gradle build file. SImply change the following line:jmTestFiles = [file("src/test/jmeter/roulette_test_plan.jmx")] to jmTestFiles = [file("src/test/jmeter/roulette_test_plan_short_time.jmx")]

The application has been developed based on the information found in https://en.wikipedia.org/wiki/Roulette

roulette-api's People

Contributors

sawan07 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.