Custom OrderProcessed event, CPU/allocation/lock workloads, a diagnostic endpoint over the JVM's live FlightRecorder state, a JUnit test using the jdk.jfr.Recording API, and nine captured recordings (flagship, mid-flight snapshot, isolated vs concurrent threshold comparisons, and a real dump+stop duplication bug) with their docs/output/*.txt transcripts.
16 lines
848 B
Plaintext
16 lines
848 B
Plaintext
$ java -cp target/classes com.ankurm.jfr.events.BrokenEventPatternDemo
|
|
calls: 200
|
|
exceptions thrown: 41
|
|
events committed: 159
|
|
expected if lossless: 200
|
|
events missing: 41 (== exceptions thrown)
|
|
|
|
BrokenEventPattern.processWithoutTryFinally() has no try/finally around
|
|
event.commit(); when riskyStep() throws (about one call in five, by design),
|
|
execution leaves the method from the catch in the demo driver, not from the line
|
|
that would have called commit(). The event threshold was forced to 0 ms for this
|
|
run specifically to rule out "the event was just too fast to pass the default
|
|
threshold" as an alternative explanation -- every one of the 41 missing events is
|
|
attributable to the missing try/finally, not to filtering. No exception, log line,
|
|
or JFR.check output calls this out: the only way to notice is to count.
|