Skip to content

parttimenerd/basic-jfr-processor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Java Thread Dump Parser Library

CI Maven Central Version

A small Java library for using the JMC Flight Recorder (JFR) APIs to process and write JFR API Events.

Features

  • Roundtrip test: Read JFR file -> process -> write JFR file -> and the events are the same
  • Supports all JFR features (that I can think of)
  • Supports modifying events

It's the foundation of jfr-redact

Maven

<dependency>
    <groupId>me.bechberger</groupId>
    <artifactId>basic-jfr-processor</artifactId>
    <version>0.1.2</version>
</dependency>

Usage

// Create a modifier that drops events
JFREventModifier modifier = new JFREventModifier() {
    @Override
    public boolean shouldRemoveEvent(RecordedEvent event) {
        return event.getEventType().getName().equals("example.UserLogin");
    }
};

// Process the recording
JFRProcessor processor = new JFRProcessor(modifier, inputFile);
try (FileOutputStream out = new FileOutputStream(outputFile.toFile())) {
    processor.process(out).close();
}

See the SimpleProcessorExample.java for a complete working example.

Testing

# Run all tests
mvn test

Deployment

Use the included Python script to automate version bumps and releases:

# Bump minor version, run tests, build
./release.py

./release.py --patch

# Full release: bump, test, build, deploy, commit, tag, push
./release.py --deploy --push

# Dry run to see what would happen
./release.py --dry-run

Support, Feedback, Contributing

This project is open to feature requests/suggestions, bug reports etc. via GitHub issues. Contribution and feedback are encouraged and always welcome.

License

MIT, Copyright 2026 SAP SE or an SAP affiliate company, Johannes Bechberger and contributors

About

A small Java library for using the JMC JFR API to write RecordedEvents to file

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors