[GLASSFISH-17175] Add begin and end attributes to @Probe to instrument either at the beginning or end of the method. Created: 09/Aug/11  Updated: 09/Aug/11

Status: Open
Project: glassfish
Component/s: monitoring
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Jennifer Chou Assignee: Byron Nevins
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


Currently probes are only instrumented at either the beginning (or end - not sure which) of the method.
Adding begin and end attributes allows more flexibility, esp. usefully in calculating processing times.

Comment by Byron Nevins [ 09/Aug/11 ]

The injected code is put at the BEGINNING of the method

You can verify by:

1) set AS_DEBUG=true in your environment
2) decompile and look at any of the re-written .class files in (on my machine)
– of course you have to look at an instrumented method that actually *has* some code!

Example 1:

public static void gc()

{ ProbeRegistry.invokeProbe(177, new Object[0]); Runtime.getRuntime().gc(); }


Example 2
Deploy MonApp [1] and access it in a browser first

public void myProbe(String arg1)
ProbeRegistry.invokeProbe(157, new Object[]

{ ??? }

String s;
System.out.println("inside myProbeMethod called with this arg: " + s);

Source: https://svn.java.net/svn/glassfish~svn/trunk/v2/appserv-tests/devtests/admin/cli/apps/MonApp
War file: https://svn.java.net/svn/glassfish~svn/trunk/v2/appserv-tests/devtests/admin/cli/resources/MonApp.war

Generated at Thu Sep 03 20:04:54 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.