Git Product home page Git Product logo

rinha-de-backend-2024-q1's Introduction

rinhabackend_nodejs

This is a project written using Express, with the language Node.

The goal was to fulfill the requirements of the "Rinha Backend - API Challenge".

The idea was to create a very simple set of API endpoints and run against a Gatling scenario stress-test, as per the instructions above.

You can use the "docker-compose.yml" provided to spin up the environment with the resource restrictions from the challenge and run the Gatling script against it.

When you want to run the stress test and monitor each container, you can use tmuxp to open htop to monitor the app, postgres, redis and nginx with:

tmuxp load tmux-monitor.yaml

Results

Click here for the Gatling stress-test simulation script.

This is Gatling's results:

================================================================================
---- Global Information --------------------------------------------------------
> request count                                      61503 (OK=61448  KO=55    )
> min response time                                      0 (OK=0      KO=1     )
> max response time                                   1040 (OK=1040   KO=381   )
> mean response time                                    30 (OK=30     KO=105   )
> std deviation                                        100 (OK=100    KO=115   )
> response time 50th percentile                          3 (OK=3      KO=62    )
> response time 75th percentile                         21 (OK=21     KO=156   )
> response time 95th percentile                         94 (OK=94     KO=344   )
> response time 99th percentile                        640 (OK=640    KO=363   )
> mean requests/sec                                251.033 (OK=250.808 KO=0.224 )
---- Response Time Distribution ------------------------------------------------
> t < 800 ms                                         61303 (100%)
> 800 ms <= t < 1200 ms                                145 (  0%)
> t >= 1200 ms                                           0 (  0%)
> failed                                                55 (  0%)
---- Errors --------------------------------------------------------------------
> status.find.in(422), but actually found 200                        20 (36,36%)
> jmesPath(ultimas_transacoes[0].descricao).find.is(danada), but     12 (21,82%)
 actually found toma
> jmesPath(ultimas_transacoes[0].descricao).find.is(danada), but      8 (14,55%)
 actually found descricao
> jmesPath(ultimas_transacoes[0].descricao).find.is(devolve), bu      3 ( 5,45%)
t actually found toma
> j.u.NoSuchElementException: No attribute named 'limite' is def      3 ( 5,45%)
ined
> jmesPath(saldo.total).find.is(0), but actually found 35995          2 ( 3,64%)
> jmesPath(ultimas_transacoes[0].descricao).find.is(devolve), bu      2 ( 3,64%)
t actually found descricao
> jmesPath(saldo.total).find.is(0), but actually found 2358           1 ( 1,82%)
> jmesPath(saldo.total).find.is(0), but actually found 1327           1 ( 1,82%)
> jmesPath(saldo.total).find.is(0), but actually found 2525           1 ( 1,82%)
> jmesPath(saldo.total).find.is(0), but actually found 12800          1 ( 1,82%)
> jmesPath(saldo.total).find.is(-25), but actually found 35994        1 ( 1,82%)
================================================================================

Graph 1

Graph 2

Setting up the project

  1. Install deps npm install
  2. Run npm start

Using Docker for development

  1. Install Docker
  2. Run docker compose up -f dev-docker-compose.yml

To configure the container, update the docker-compose.yml file, and the docker/development.dockerfile file.

rinha-de-backend-2024-q1's People

Contributors

carlosviniciusananias avatar

Watchers

 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.