Skip to content

IvanVas/ab-splitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A/B splitter microservice

Used to determine user's group for A/B testing

Requirements

Java 8 is required to run the service.

API

User's group route

Get user's testing group: GET /v1/route/:user

Parameters

Response

Status: 200 OK {"group":"c"}

Error response

Status: 400 or 500 {"group":"","errorMessage":"Wrong API version","errorCode":"400"}

HTTP Status Code Summary

200 OK - Everything worked as expected.

400 Bad Request - Wrong API version.

500 - something went wrong on service's end.

Performance

Reference platform: Windows 7 SP1 x64 AMD Phenom II X4 3.2GHz 8GB RAM

  • 10 threads sampling: 2ms avg response time, 2934 req/s
  • 50 threads sampling: 13ms avg response time, 3150 req/s
  • 100 threads sampling: 30ms avg response time, 3081 req/s
  • 200 threads sampling: 61ms avg response time, 3122 req/s

Horizontal scaling is theoretically linear (if load balancer is not a bottleneck). To be confirmed by testing.

  • Performance can be tested using maven: mvn jmeter:jmeter. The service should be started before the command.
  • There are several tests defined (in src/test/jmeter) for different number of simultaneous client threads.
  • Results can be viewed in console or as files in target\jmeter\results\

Usage and configuration

Configuration file:

{ "port": 8080, "groupWeights": { "a": 30, "b": 20, "c": 50 } }

Usage

mvn package builds an executable jar ab-splitter-service.jar

To start the service: java -jar ab-splitter-service.jar <config file path>

About

A/B tests splitter microservice.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages