{"id":20474200,"url":"https://github.com/marschall/junit-jfr","last_synced_at":"2025-04-13T11:32:30.938Z","repository":{"id":57721292,"uuid":"161069698","full_name":"marschall/junit-jfr","owner":"marschall","description":"a JUnit 5 extension that generates JFR events","archived":false,"fork":false,"pushed_at":"2020-10-17T17:35:46.000Z","size":451,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T02:43:12.656Z","etag":null,"topics":["java-flight-recorder","junit","junit-5","junit5"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marschall.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-09T18:38:06.000Z","updated_at":"2023-02-07T11:41:48.000Z","dependencies_parsed_at":"2022-09-26T21:41:28.522Z","dependency_job_id":null,"html_url":"https://github.com/marschall/junit-jfr","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marschall%2Fjunit-jfr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marschall%2Fjunit-jfr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marschall%2Fjunit-jfr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marschall%2Fjunit-jfr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marschall","download_url":"https://codeload.github.com/marschall/junit-jfr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248705531,"owners_count":21148549,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java-flight-recorder","junit","junit-5","junit5"],"created_at":"2024-11-15T14:28:34.536Z","updated_at":"2025-04-13T11:32:30.901Z","avatar_url":"https://github.com/marschall.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"JUnit JFR [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.marschall/junit-jfr/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.marschall/junit-jfr) [![Javadocs](https://www.javadoc.io/badge/com.github.marschall/junit-jfr.svg)](https://www.javadoc.io/doc/com.github.marschall/junit-jfr) [![Build Status](https://travis-ci.org/marschall/junit-jfr.svg?branch=master)](https://travis-ci.org/marschall/junit-jfr)\n=========\n\nA JUnit extension that generates JFR events.\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.marschall\u003c/groupId\u003e\n  \u003cartifactId\u003ejunit-jfr\u003c/artifactId\u003e\n  \u003cversion\u003e0.1.0\u003c/version\u003e\n  \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\nRequires Java 11 based on OpenJDK.\n\n![Flight Recording of a JUnit Test](https://raw.githubusercontent.com/marschall/junit-jfr/master/src/main/javadoc/screenshot.png)\n\nEvent Types\n-----------\n\nThe extension supports the following event types in the \"JUnit\" category.\n\n\u003cdl\u003e\n\u003cdt\u003e@BeforeAll\u003c/dt\u003e\n\u003cdd\u003eContains the execution of all \u003ccode\u003e@BeforeAll\u003c/code\u003e methods.\u003c/dd\u003e\n\u003cdt\u003e@BeforeEach\u003c/dt\u003e\n\u003cdd\u003eContains the execution of all \u003ccode\u003e@BeforeEach\u003c/code\u003e methods.\u003c/dd\u003e\n\u003cdt\u003e@Test\u003c/dt\u003e\n\u003cdd\u003eContains the execution of all \u003ccode\u003e@Test\u003c/code\u003e methods.\u003c/dd\u003e\n\u003cdt\u003e@AfterEach\u003c/dt\u003e\n\u003cdd\u003eContains the execution of all \u003ccode\u003e@AfterEach\u003c/code\u003e methods.\u003c/dd\u003e\n\u003cdt\u003e@AfterAll\u003c/dt\u003e\n\u003cdd\u003eContains the execution of all \u003ccode\u003e@AfterAll\u003c/code\u003e methods.\u003c/dd\u003e\n\u003c/dl\u003e\n\nEvery event type may also cover some extension methods.\n\nUsage\n-----\n\n* Add `@JfrProfiled` to your unit test class, see [JfrExtensionTest](https://github.com/marschall/junit-jfr/blob/master/src/test/java/com/github/marschall/junit/jfr/JfrExtensionTest.java) for and example.\n* Generate a flight recording from your unit tests, eg using\n```\n-XX:StartFlightRecording:filename=recording.jfr\n-XX:FlightRecorderOptions:stackdepth=128\n```\n\n```java\n@JfrProfiled\nclass ProfiledTests {\n\n  @Test\n  void testMethod() {\n    // implementation\n  }\n\n}\n```\n\nComparison with JUnit 5.7 JFR Support\n-------------------------------------\n\nBuilt in JFR support in JUnit 5.7 is much easier to use as it requires only adding the `org.junit.platform:junit-platform-jfr` and no additional annotations. However the built in JFR support in JUnit does not generate events for `@BeforeAll`, `@BeforeEach`, `@AfterEach` and `@AfterAll` methods.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarschall%2Fjunit-jfr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarschall%2Fjunit-jfr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarschall%2Fjunit-jfr/lists"}