Accounts Quarkus

crabzilla.v0.5.7 orange CI codecov

This is an example of an application using Crabzilla with Quarkus

Overview

Requirements

  • Java 11

  • Maven

  • Docker compose

  • K6 for running stress test

Building

1 - Start Postgres:

docker-compose up

2 - Build it, running both unit and integration tests:

mvn clean install

Running

1 - Start Postgres if no already started:

docker-compose up

2 - Run the using Quarkus dev mode:

mvn compile quarkus:dev

3 - Exploring api

Transfer test

Open an account 1 with 110.00 and 2 with 0.00 then make a 100.00 transfer from account 1 to 2:

k6 run - <./k6/transfer.js

Note: on Mac M1 you will need to install and run K6 locally. I still have to figure out this bug.

Stress test

Opening many accounts with 1000 virtual users during 60 seconds:

k6 run - <./k6/open-many-accounts.js

And you will see something like:

         /\      |‾‾| /‾‾/   /‾‾/
     /\  /  \     |  |/  /   /  /
    /  \/    \    |     (   /   ‾‾\
   /          \   |  |\  \ |  (‾)  |
  / __________ \  |__| \__\ \_____/ .io

  execution: local
     script: -
     output: -

  scenarios: (100.00%) 1 scenario, 1000 max VUs, 1m30s max duration (incl. graceful stop):
           * default: 1000 looping VUs for 1m0s (gracefulStop: 30s)


     data_received..................: 28 MB 459 kB/s
     data_sent......................: 15 MB 239 kB/s
     http_req_blocked...............: avg=6.55ms   min=1.13µs   med=2.63µs   max=1.14s    p(90)=4.61µs  p(95)=6.43µs
     http_req_connecting............: avg=6.48ms   min=0s       med=0s       max=1.02s    p(90)=0s      p(95)=0s
     http_req_duration..............: avg=1.09s    min=505.72ms med=877.96ms max=2.52s    p(90)=1.55s   p(95)=1.75s
       { expected_response:true }...: avg=1.09s    min=505.72ms med=877.96ms max=2.52s    p(90)=1.55s   p(95)=1.75s
     http_req_failed................: 0.00% ✓ 0          ✗ 55012
     http_req_receiving.............: avg=47.94µs  min=13.33µs  med=42.99µs  max=9.55ms   p(90)=70.5µs  p(95)=85.68µs
     http_req_sending...............: avg=192.25µs min=8.01µs   med=19.25µs  max=149.53ms p(90)=30.86µs p(95)=42.68µs
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s      p(95)=0s
     http_req_waiting...............: avg=1.09s    min=503.94ms med=877.89ms max=2.52s    p(90)=1.55s   p(95)=1.75s
     http_reqs......................: 55012 895.945492/s
     iteration_duration.............: avg=1.1s     min=547.04ms med=879.2ms  max=2.52s    p(90)=1.57s   p(95)=1.79s
     iterations.....................: 55012 895.945492/s
     vus............................: 267   min=267      max=1000
     vus_max........................: 1000  min=1000     max=1000