Configure Server-Side Profiling with PAS for OpenEdge
- Last Updated: January 30, 2025
- 4 minute read
- OpenEdge
- Version 12.2
- Documentation
This topic explains how to use JMX to enable Server-Side Profiling on a PAS for OpenEdge instance. You may not want to gather performance data for every request handled by an instance. Use filters to restrict which requests are profiled on a particular instance. Filters are configured and enabled using JMX and REST APIs. Filters are described in the Supported JSON values for JMX queries topic.
For information on how to configure and enable filters using REST APIs, see Push profiler data and Get profiler settings.
Before executing the steps in this topic, ensure the diagnostic store is deployed and running.
In this procedure, you are configuring profiling on the target PAS for OpenEdge instance and sending the profiled data to the diagnostic store. Perform the following steps:
- Ensure the diagnostic store and the target PAS for OpenEdge
instance are running. The target instance requires the
oemanager.wardeployed to access REST APIs. - Run an JMX query to return the list of MS Agents running for a given ABL
application on the target instance:
- In the
/bindirectory of the target instance, create a JMX query calledagentInfo.qry. For example:{"O":"PASOE:type=OEManager,name=AgentManager","M":["getAgents","APP_NAME"]}where APP_NAME is the ABL application you want to profile.
- Run the
query:
oejmx.[bat|sh] -R -Q agentInfo.qryThe output of the file is sent to the
instance-name/tempdirectory - Open the
agentInfooutput file and copy theagentIdvalue. This ID is used in the following steps.
- In the
- In the
/bindirectory of the target instance, create a JMX query to capture diagnostic data.The following example query captures diagnostic information for the next 100 Server Status requests. It also uses the
AdapterMaskandProclistfilters. See Supported JSON values for JMX queries for a list of supported Profiler Settings.
where:{"O":"PASOE:type=OEManager,name=AgentManager", "M":["pushProfilerData","AGENT_ID", "http://host:port/oediagstore/web/diag",100, "{\"Coverage\":true,\"AdapterMask\":null, \"ProcList\":null,\"TestRunDescriptor\":\"Sample Test\"}"]}- host and port to point to the diagnostic store.
- AGENT_ID is the agent ID running on the target instance
Note: In this example, providingnullvalue is equivalent to not providing a filter. In such a case, the filter uses the default value. - Execute the query to start
profiling:
oejmx.[bat|sh] -R -Q diaginfo.qryThe output is sent to the
instance-name/tempdirectory.The following output is returned:
{"pushProfilerData": {"ABLReturnVal":true, "agentId":"solo8Wm7TquALsSQ1lpX4g", "pid":"8116"}}If the result of
ABLReturnValistrue, the JMX Query executed successfully and profiling is successfully enabled on the target PAS for OpenEdge instance. - Execute the following query to get the profiler settings and save it
in the instance-name/bin directory as
profilersettings.qry:
where{"O":"PASOE:type=OEManager,name=AgentManager", "M":["getProfilerSettings","AGENT_ID"]}AGENT_IDis the agent ID. - Run the following query to show that the profiler settings for the
target PAS for OpenEdge instance are
enabled:
oejmx.[sh|bat] -R -Q profilersettings.qryThe output is sent to the target
instance-name/tempdirectory.The following result is returned:{"getProfilerSettings":{"ABLOutput": { "AdapterMask":"APSV,SOAP,REST,WEB", "ProcList":"", "RequestHiBound":-1, "TestRunDescriptor":"Sample Test", "bufsize":128, "RequestLoBound":0, "Coverage":true, "RequestCount":100, "Statistics":false, "URL":"http://localhost:8850/oediagstore/web/diag"}, "ABLReturnVal":true, "agentId":"solo8Wm7TquALsSQ1lpX4g", "pid":"8116" } } - Run a sample
_oepingservice on the target instance to see if the REST Service ABL Code is profiled and sent to the diagnostic store.If the request matches the filters you specified in the JMX query, the agent in the instance pushes the profiling data to the diagnostic store.
curl http://host:port/rest/_oepingService/_oepingThe
_oepingServicecalls the ABL classOpenEdge.Rest.Admin.AppServerStatusand invokesServerStatus. Since this matches the filter and theAdapterMaskisREST, this request is profiled and the profiler output is sent to the diagnostic store. For more information about the OE Ping Service, see ABL application PING service. - To view and analyze the profiler data, export the data from the diagnostic
store (
oediagdb) to a.proffile and open that file in Progress Developer Studio.To export the data, run the following ABL code in the Procedure Edtior after connecting to the diagnostic store database:
DEFINE VAR requestId as Integer NO-UNDO. DEFINE VAR fileName as Character NO-UNDO. FOR EACH ProfiledRequest: requestId = requestId + 1. fileName = "C:/OpenEdge/WRK/profiler_" + STRING(requestId) + ".prof". COPY-LOB ProfiledRequest.PerfData TO FILE fileName. MESSAGE fileName VIEW-AS ALERT-BOX. END.Note: On UNIX or Windows, replace C:/OpenEdge/WRK with the full system path to the WRK directory where you want to put the profiler files. - From the specified WRK
directory, open the generated .prof in
Progress Developer Studio, or other profiler tool, to view the profiled data.
In Progress Developer Studio, the profiled data appears in the Module Details page. It shows a summary of the events observed during the run-time ping request.
Figure 1. Example ABL Profiler Data in Progress Developer Studio