Fully featured low overhead profiler for Java EE and Java SE platforms.
Easy-to-use performance and memory .NET profiler for Windows, Linux and macOS.
Secure and easy profiling in cloud, containers and clustered environments.
Performance monitoring and profiling of Jenkins, Bamboo, TeamCity, Gradle, Maven, Ant and JUnit.

Callback onExit()

Callback method onExit() can be used instead of two separate callbacks onReturn() and onUncaughtException(). It helps to avoid code duplication when, for example, a lasting event created in onEnter() should be closed on normal return as well as on exception.

Only one method named onExit() can exist in a probe class. It cannot be used together with onReturn() or onUncaughtException().

Difference from onReturn() and onUncaughtException()

onExit() can use both @ThrownException and @ReturnValue callback parameters.

If instrumented method exits without throwing an exception, @ThrownException parameter will be null, and @ReturnValue parameter will be assigned accordingly.

If instrumented method throws an exception, @ThrownException parameter value will be assigned, and @ReturnValue parameter will be null or zero.

Parameters

The callback can have any number of parameters, including zero.

Each of the parameters must be annotated with one of the following annotations:

YourKit uses cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content, to analyze our website traffic, and to understand where our visitors are coming from.

By browsing our website, you consent to our use of cookies and other tracking technologies in accordance with the Privacy Policy.