Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ammbra/performance-glance

Repository containing simple springboot todo app with JFR, prometheus and grafana enabled
https://github.com/ammbra/performance-glance

grafana java20 jfr prometheus springboot tools

Last synced: about 2 hours ago
JSON representation

Repository containing simple springboot todo app with JFR, prometheus and grafana enabled

Awesome Lists containing this project

README

        

# perfomance-glance

## How to find out the modules needed by jlink

Uncomment the `maven-dependency-plugin` plugin in `pom.xml`:

```xml

org.apache.maven.plugins
maven-dependency-plugin
${maven.dependency.plugin.version}


copy-dependencies
package

copy-dependencies


${project.build.directory}/libs
false
false
true




```
Then run the following commands in a terminal window:

```shell
mvn verify
jdeps --ignore-missing-deps -q -recursive --multi-release 21 \
--print-module-deps --class-path 'target/libs/*' target/spring-todo-app.jar
```

## How to start the setup

Place yourself in the root directory and run :
```shell
docker-compose up --build
```
You can access the following endpoints:

| Application | Local Endpoint |
|-------------|-----------------------|
| Todo App | http://localhost:8080 |
| Prometheus | http://localhost:9090 |
| Grafana | http://localhost:300 |

Now create some requests by running:

```shell
sh scripts/load.sh
```

### How to detect missing JVM NativeMemoryTracking flag

Please take a look at /scripts/flag.sh and:

```shell
sh scripts/flag.sh
```

### How to track Native Memory Used
Run

```shell
sh scripts/track.sh
```
### How to query stats
Run

```shell
sh scripts/query.sh
```

## Prometheus
### Look at CPU Load Machine Total vs HTTP server requests

```shell
rate(jdk_CPULoadmachineTotal[1m])
or rate(http_server_requests_seconds_sum{method="POST", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="GET", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="PUT", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="DELETE"}[1m])
```

### Look at Garbage Collection Longest Pause vs HTTP server requests

```shell
rate(jdk_GarbageCollectionlongestPause[1m])
or rate(http_server_requests_seconds_sum{method="POST", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="GET", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="PUT", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="DELETE"}[1m])
```

### Look at Garbage Collection Sum of Pauses vs HTTP server requests

```shell
rate(jdk_GarbageCollectionsumOfPauses[1m])
or rate(http_server_requests_seconds_sum{method="POST", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="GET", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="PUT", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="DELETE"}[1m])
```
### Look at GCHeapSummary Heap Used

```shell
rate(jdk_GCHeapSummaryheapUsed[1m])
or rate(http_server_requests_seconds_sum{method="POST", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="GET", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="PUT", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="DELETE"}[1m])
```