Git Product home page Git Product logo

jfrunit-examples's Introduction

Examples for JfrUnit

Some examples for spotting potential performance regressions using JfrUnit. JfrUnit must be installed into the local Maven repository. Alternatively, adjust the JfrUnit dependency in example-service/pom.xml to the JitPack coordinates specified in the README in the JfrUnit repository.

Build

This project requires OpenJDK 15 or later for its build. Apache Maven is used for the build.

Run the following to build the project:

cd user-service
mvn clean verify
java -Dquarkus.http.port=8082 -jar target/jfrunit-demo-user-1.0.0-SNAPSHOT-runner.jar

This starts the "user" service, which is accessed by the example service within one of the regression scenarios. Then build the example service itself:

cd example-service
mvn clean verify

In each test class, there's a method ...Regression() with an assertion that's commented out. When commenting it in, this test should fail due to a performance "regresssion", e.g. due to higher memory allocation than expected, more IO, or more SQL statements.

Running in the IDE

When running the TodoResourceSqlStatementsTest in your IDE, make sure to specify the correct JMC Agent configuration, as seen in the example-service/pom.xml file.

Running the Application

For manual testing, build the application, start a separate Postgres instance via Docker Compose and launch the app like so:

docker-compose up
cd example-service
clean verify -DskipTests=true
java -jar ./example-service/target/quarkus-app/quarkus-run.jar

# Testing, e.g. via httpie
http POST localhost:8080/todo title=Test priority=2 completed=true

License

This code base is available under the Apache License, version 2.

jfrunit-examples's People

Contributors

gunnarmorling avatar

Watchers

James Cloos 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.