Package de.cuioss.benchmarking.common.jfr


package de.cuioss.benchmarking.common.jfr
Java Flight Recorder (JFR) utilities for benchmark analysis.

This package provides common JFR functionality that can be reused across different benchmark implementations:

Usage Example:


 // Check JFR support
 if (!JfrSupport.isAvailable()) {
     System.out.println("JFR not available, skipping instrumentation");
     return;
 }
 
 // Start recording directly
 Recording recording = new Recording();
 recording.setDestination(Path.of("benchmark.jfr"));
 recording.setName("My Benchmark");
 recording.start();
 
 // Use instrumentation
 JfrInstrumentation instrumentation = new JfrInstrumentation();
 try {
     // Record operations
     try (var recorder = instrumentation.recordOperation("MyBenchmark", "validation")) {
         // Perform operation
         recorder.withPayloadSize(1024)
                 .withSuccess(true);
     }
 } finally {
     instrumentation.shutdown();
     recording.stop();
     recording.close();
 }
 
 // Analyze results
 JfrVarianceAnalyzer analyzer = new JfrVarianceAnalyzer();
 var report = analyzer.analyze(Path.of("benchmark.jfr"));
 report.printSummary();