OEJMX provides access to agent and session metrics, which can give administrators insights into the PAS for OpenEdge instance. This topic discusses how to generate session metrics for an agent, and shows the general process for running these types of queries. There are numerous other JMX APIs available which are described in Common OEJMX queries and the OEJMX Query Reference. These queries can provide different levels of insight into a PAS for OpenEdge instance.

Additionally, the APIs described in the AgentManager section of the oejmx -C output are available for use as well. These operations are described in the List available MBeans to locate AgentManager details topic.

To use OEJMX to generate session metrics for an agent:
  1. Ensure the PAS for OpenEdge instance is running.
  2. Obtain the Agent ID or PID for the agent that you want to query for session metrics. These can be obtained by running the getAgents query, which is described in Use an OEJMX query to get agent information.
    Note: In place of the Agent ID or PID, you can use the AGENT_ID token, which provides information for all running agents. However, the best practice is to use explicit names over tokens to guarantee the intended results.
  3. In the instance_name\bin\jmxqueries directory, create a file called getSessionMetrics.qry, and insert the following line into the file:
    {"O":"PASOE:type=OEManager,name=AgentManager","M":["getSessionMetrics","31288"]}
    
    In the above example, replace 31288 with the Agent ID or PID that you obtained for a running agent.
    Note: To obtain session metrics for each running agent on the PAS for OpenEdge instance, specify the AGENT_ID token in place of the Agent ID value, for example:
    {"O":"PASOE:type=OEManager,name=AgentManager","M":["getSessionMetrics","AGENT_ID"]}
    
    For more information about tokens, see OEJMX utility.
  4. Run the getSessionMetrics query using the OEJMX command from the bin directory of the instance, for example:
    proenv>oejmx -Q jmxqueries\getSessionMetrics.qry

    The default output location is instance_name/temp/getSessionMetrics-out-yyMMdd-HHmm.txt.

  5. Review the output getSessionMetrics-outyyMMdd-HHmm.txt file in the instance_name/temp directory to see the query response. It looks similar to the following example:
    Query: Line 1. PASOE:type=OEManager,name=AgentManager, getSessionMetrics(b4XlcFFOR_uh68bStvHe1Q)
    Result: {"getSessionMetrics":{"AgentSession":[{"SessionState":"IDLE","ConnectionId":"org.codehaus.jettison.json.JSONObject$Null",
    "SessionMemory":758020,"EndTime":"org.codehaus.jettison.json.JSONObject$Null",
    "ThreadId":-1,"SessionExternalState":0,"StartTime":"2020-09-10T11:32:44.485+04:00","SessionId":4},
    {"SessionState":"IDLE","ConnectionId":"org.codehaus.jettison.json.JSONObject$Null",
    "SessionMemory":758020,"EndTime":"org.codehaus.jettison.json.JSONObject$Null",
    "ThreadId":-1,"SessionExternalState":0,"StartTime":"2020-09-10T11:32:44.485+04:00","SessionId":7}]}}

    The output of the getSessionMetrics query provides the session IDs for the running ABL application agents. You can use this information to gather more information about your agent, such as generating a stack trace. For more information about generating a stack trace, see the Get a stack trace for a session query topic.

This topic shows the basic procedure for writing OEJMX queries, running them on the console, and viewing the output of the query. Multiple queries can be included in a single OEJMX query file. More examples of OEJMX queries can be found in Common OEJMX queries and the OEJMX Query Reference.