glassfish
  1. glassfish
  2. GLASSFISH-17175

Add begin and end attributes to @Probe to instrument either at the beginning or end of the method.

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: monitoring
    • Labels:
      None

      Description

      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.

        Activity

        Hide
        Byron Nevins added a comment -

        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)
        D:\glassfish3\glassfish\flashlight-generated
        – 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

        @Probe(name="myProbe")
        public void myProbe(String arg1)
        {
        ProbeRegistry.invokeProbe(157, new Object[]

        { ??? }

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

        [1]
        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

        Show
        Byron Nevins added a comment - 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) D:\glassfish3\glassfish\flashlight-generated – 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 @Probe(name="myProbe") public void myProbe(String arg1) { ProbeRegistry.invokeProbe(157, new Object[] { ??? } ); String s; System.out.println("inside myProbeMethod called with this arg: " + s); } [1] 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

          People

          • Assignee:
            Byron Nevins
            Reporter:
            Jennifer Chou
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: