Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fugerit-org/fj-doc-quarkus-demo
Fugerit Venus Doc Examples Applications
https://github.com/fugerit-org/fj-doc-quarkus-demo
Last synced: 13 days ago
JSON representation
Fugerit Venus Doc Examples Applications
- Host: GitHub
- URL: https://github.com/fugerit-org/fj-doc-quarkus-demo
- Owner: fugerit-org
- License: mit
- Created: 2024-07-30T22:00:44.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-12-13T06:14:48.000Z (24 days ago)
- Last Synced: 2024-12-13T07:20:25.691Z (24 days ago)
- Language: HTML
- Size: 622 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# fj-doc-quarkus-demo
Simple demo application to test performances of [Fugerit Venus Doc](https://github.com/fugerit-org/fj-doc) library.
[![Keep a Changelog v1.1.0 badge](https://img.shields.io/badge/changelog-Keep%20a%20Changelog%20v1.1.0-%23E05735)](CHANGELOG.md)
[![license](https://img.shields.io/badge/License-MIT%20License-teal.svg)](https://opensource.org/license/mit)
[![code of conduct](https://img.shields.io/badge/conduct-Contributor%20Covenant-purple.svg)](https://github.com/fugerit-org/fj-doc-quarkus-demo/blob/main/CODE_OF_CONDUCT.md)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=fugerit-org_fj-doc-quarkus-demo&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=fugerit-org_fj-doc-quarkus-demo)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=fugerit-org_fj-doc-quarkus-demo&metric=coverage)](https://sonarcloud.io/summary/new_code?id=fugerit-org_fj-doc-quarkus-demo)
[![Docker images](https://img.shields.io/badge/dockerhub-images-important.svg?logo=Docker)](https://hub.docker.com/repository/docker/fugeritorg/fj-doc-quarkus-demo/general)[![Java version](https://img.shields.io/badge/JD-java%2021+-%23113366.svg?style=for-the-badge&logo=openjdk&logoColor=white)](https://universe.fugerit.org/src/docs/versions/java21.html)
[![Apache Maven](https://img.shields.io/badge/Apache%20Maven-3.9.0+-C71A36?style=for-the-badge&logo=Apache%20Maven&logoColor=white)](https://universe.fugerit.org/src/docs/versions/maven3_9.html)
[![Fugerit Github Project Conventions](https://img.shields.io/badge/Fugerit%20Org-Project%20Conventions-1A36C7?style=for-the-badge&logo=Onlinect%20Playground&logoColor=white)](https://universe.fugerit.org/src/docs/conventions/index.html)Here you can find [quarkus original readme](README_QUARKUS.md).
## Quickstart
After clone, from the project root :
### 1. Build
```shell
mvn clean package
```### 2. Run benchmark script
Benchmark script needs :
- *bash* (required)
- *[h2load](https://github.com/nghttp2/nghttp2)* (required)
- *[psrecord](https://pypi.org/project/psrecord/)* (optional, if not present plot will be skipped)```shell
./src/main/script/bench-graph-h2-load.sh pdf-fop 1000
```**The script accepts these positional arguments :**
| position | required | default | description |
|------------------------|----------|---------|-------------------------------------------------------------------------------|
| 1 (HANDLER) | true | | handler id : 'pdf-fop', 'pdf-fop-pool', 'pdf-a-fop', 'pdf-ua-fop' , 'openpdf' |
| 2 (NUMBER_OF_REQUESTS) | false | 50000 | Total number of requests to run (h2load -n) |
| 3 (NUMBER_OF_CLIENTS) | false | 60 | Number of concurrent clients (h2load -c) |
| 4 (NUMBER_OF_THREADS) | false | 4 | Number of concurrent threads (h2load -t) |**Currently configured pdf handlers :**
- *pdf-fop* - vanilla [pdf fop handler](https://github.com/fugerit-org/fj-doc/tree/main/fj-doc-mod-fop)
- *pdf-fop-pool* - [pdf fop handler with pooling](https://github.com/fugerit-org/fj-doc/tree/main/fj-doc-mod-fop) (min:20, max:40)
- *pdf-a-fop* - [pdf-a fop handler](https://github.com/fugerit-org/fj-doc/tree/main/fj-doc-mod-fop)
- *pdf-a-fop* - [pdf-ua fop handler](https://github.com/fugerit-org/fj-doc/tree/main/fj-doc-mod-fop)
- *openpdf* - [openpdf handler](https://github.com/fugerit-org/fj-doc/tree/main/fj-doc-mod-openpdf-ext)It is possible to change doc handlers configuration from the [freemarker-doc-process.xml](src/main/resources/fj-doc-demo-config/freemarker-doc-process.xml) XML configuration.
### 3. Run and test
```shell
mvn quarkus:dev
```open
## Benchmark suit
This script run benchmark on all doc handlers and write the output to *target/* folder.
```shell
./src/main/script/bench-graph-h2-load-complete.sh
```Here is an example of the files generated by the suite in *target/* folder :
```
out_openpdf.log
out_openpdf.png
out_pdf-fop-pool.log
out_pdf-fop-pool.png
out_pdf-fop.log
out_pdf-fop.png
```Below is the example content of the *target/out_pdf-fop.log* file :
```
starting benchmark...
spawning thread #0: 15 total client(s). 250 total requests
spawning thread #1: 15 total client(s). 250 total requests
spawning thread #2: 15 total client(s). 250 total requests
spawning thread #3: 15 total client(s). 250 total requests
Application protocol: h2c
progress: 10% done
progress: 20% done
progress: 30% done
progress: 40% done
progress: 50% done
progress: 60% done
progress: 70% done
progress: 80% done
progress: 90% done
progress: 100% donefinished in 779.33ms, 1283.15 req/s, 21.16MB/s
requests: 1000 total, 1000 started, 1000 done, 1000 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 1000 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 16.49MB (17295040) total, 4.92KB (5040) headers (space savings 91.00%), 16.46MB (17259800) data
min max mean sd +/- sd
time for request: 4.94ms 178.98ms 43.29ms 28.90ms 67.80%
time for connect: 61us 995us 450us 257us 61.67%
time to 1st byte: 13.75ms 104.97ms 36.04ms 19.11ms 85.00%
req/s : 20.61 32.65 23.25 2.37 81.67%
```NOTE: if *psrecord* is not present, no *png* will be created.
And here is some samples
| fj-doc | platform | java version | pdf-fop | pdf-fop-pool | openpdf | output folder | parameters |
|--------|----------------------------------------------------------| --------- | -------------------------------- | -------------------------------- | -------------------------------- |----------------------------------------------------------------------------| -------------------------------------------- |
| 8.5.0 | Macbook pro 16 max M1 32gb (Sonoma 14.5) | Oracle GraalVM 21 | 28.05s, 1782.40 req/s, 29.88MB/s | 20.81s, 2402.76 req/s, 40.28MB/s | 53.42s, 936.05 req/s, 8.89MB/s | [2024-08-03](src/test/resources/benchmark_out/2024-08-03/macpro_max_16_m1) | h2load, 50000 request, 60 clients, 4 threads |
| 8.5.0 | AMD Ryzen 3700X 32gb (Ubuntu 22) | Oracle GraalVM 21 | 28.07s, 1781.52 req/s, 29.86MB/s | 19.66s, 2543.10 req/s, 42.63MB/s | 40.91s, 1222.29 req/s, 11.61MB/s | [2024-08-03](src/test/resources/benchmark_out/2024-08-03/ryzen_3700X) | h2load, 50000 request, 60 clients, 4 threads |
| 8.5.0 | AMD Ryzen 9 3900X (24) @ 3.800GHz 128gb (Fedora 40) | OpenJDK Red Hat 21 | 20.16s, 2479.60 req/s, 41.59MB/s | 16.94s, 2951.92 req/s, 49.51MB/s | 25.30s, 1976.29 req/s, 18.93MB/s | [2024-08-03](src/test/resources/benchmark_out/2024-08-03/ryzen_9_3900X) | h2load, 50000 request, 60 clients, 4 threads |
| 8.5.0 | Container, 4 cpu, RHEL, 1200m (on Macbook pro 16 max M1) | OpenJDK Red Hat 21 | 59.89s, 834.83 req/s, 13.98MB/s | 41.97s, 1191.39 req/s, 19.95MB/s | 92.67s, 539.53 req/s, 5.12MB/s | [2024-08-05](src/test/resources/benchmark_out/2024-08-05/container_4) | h2load, 50000 request, 60 clients, 4 threads |## Benchmark with docker
### Starting cointainer (default is 1200m and 4 cpu maximu)
```shell
docker compose -f src/main/docker/docker-compose.yml up -d
```### Run benchmark
```shell
export NO_START=1;./src/main/script/bench-graph-h2-load-complete.sh
```You will need the NO_START=1 environment variable, so quarkus app will not be started by the script