Optimizing performance during development
As a developer, you should learn how to optimize the performance of applications using Pega Diagnostic Center (PDC) during the development process. This topic guides you through the essential concepts and practices for using PDC effectively, focusing on how to identify performance issues and address them. You will learn to interpret two key performance alerts - PEGA0001 and PEGA0011.
This topic assumes that you are already familiar with certain concepts. For relevant training materials about the concepts covered in this topic, see the Pega Diagnostic Center explained module.
Understanding PDC in pre-production
In the pre-production phase, PDC can assist you in designing and testing Pega applications by providing application metrics. Regular use of PDC in the development environment helps identify whether code changes introduce new issues.
Setting the performance baseline
You can not tell whether changes you make to the application affect the performance of the app unless you first have a baseline measurement of where you started. For more information about how to set a baseline, see the Troubleshooting errors during development topic. When setting a performance baseline, instead of filtering by exceptions, you can filter by alerts.
Performance is primarily measured using the following two alerts:
- PEGA0001: Measures HTTP interaction time.
- PEGA0011: Measures service request time.
PEGA0001 alert
When a user is working in a Pega application, some of their actions might trigger a request to get data from the database. Each request consists of several time measurements.
Request timeline
- The user requests the page. This action sends the request across the network to the server. The first measurement is the duration of this request.
- The Pega application creates and locks the requestor, and processes the request.
- When the processing completes, the requestor is unlocked and the reply is sent across the network to the browser.
- Some processing might be required on the browser side if there are UI structures or other elements that affect the browser.
- This process repeats for each of the requests that is made from the browser to render the application page.
The PEGA0001 alert is triggered when an HTTP interaction exceeds a defined threshold. It measures elapsed time between locking and unlocking the requestor object for an HTTP interaction and the processing time for the request.
The following figure shows the moment that the PEGA0001 alert generates, and the timeline in which it occurs:
Key metrics
The elapsed time for the PEGA0001 alert is the time taken for the requestor to process the request. A threshold of 1 second (1000 milliseconds) is set for acceptable response times.
For more information about the alert, see the PEGA0001 alert documentation.
PEGA0011 alert
The PEGA0011 alert timeline will use an example of a user logging into an application that connects through a Service Rule to a Pega application.
Request timeline
- The user logs into the website.
- The website uses a Service Rule to connect to the Pega application through an API.
- The website sends the request through to the requestor in the Pega application. The requestor is locked and the request is processed.
- When the request is completed, the requestor is unlocked and the reply is sent back to the website.
- The website displays the requested item to the user.
The PEGA0011 alert is triggered for service requests when the total request time exceeds a threshold. The total request time is measured from the time when the Pega Platform™ server receives the service request from an external system until the Pega Platform server sends the response back to the external system or client.
The following figure shows the moment that the PEGA0011 alert generates, and the timeline in which it occurs:
Key metrics
A threshold of 1 second (1000 milliseconds) is set for acceptable response times.
For more information about the alert, see the PEGA0011 alert documentation.
Analyzing performance alerts
Perform the following actions to set up the Event Viewer in PDC to display only the performance alerts you want to focus on:
- Set the following filters in the Event Viewer:
- Set your time range to the smallest time range possible.
- Filter by Type and choose Alerts. Then filter again by Event and select the PEGA0001 or PEGA0011 alert.
- Filter by Operator ID, and select your ID.
- Sort by the Metric column to identify the longest interactions.
The following figure shows the Event Viewer table filtered by the Event and Operator filter types and sorted by the Metric column:
For more information about the Event Viewer, see Event Viewer landing page.
Analyze the alerts by focusing on the following aspects:
- Investigate the Request context tab for additional events during the HTTP request.
- Examine database interactions, as many performance issues stem from database access.
- Review the Execution summary tab for rules being run during the service request.
- Check the Call stack tab to investigate the state of the requestor's call stack at the point in time that the alert was generated.
You might not be able to get the performance to perfection immediately. You can enter some entries as bugs in your tracking system or mark some as deferred.
To summarize, the PEGA0011 alert measures the application processing time for a request that comes from a service interaction, and the PEGA0001 alert tracks the application processing time for a request that comes from a browser or web interaction. But both the PEGA0011 and the PEGA0001 alerts only track application processing time, or the performance of the app.
For a full list of performance alerts, see the Performance (PEGA) alerts documentation.
Continuous performance monitoring
By consistently using PDC tools throughout the development process, you can identify errors early, reduce deployment delays, and optimize application performance. This proactive approach enhances reliability and accelerates time to value for applications.
- Regular checks: You should use PDC to assess the impact of code changes every time you check in code and run unit tests.
- Update Assessment tool: After addressing issues and establishing a performance baseline, use the Update Assessment tool for each new milestone to identify new performance alerts. For more information about the Update Assessment tool, see the Update Assessment landing page in the PDC documentation.
Key takeaways
- Identify performance issues early: PDC helps developers to pinpoint performance bottlenecks introduced by code changes, preventing slowdowns before they impact users.
- Focus on key performance metrics: Two primary PDC alerts, PEGA0001 and PEGA0011, track application processing time for user interactions and service requests.
- Optimize for a smooth user experience: By identifying and addressing performance issues with PDC, developers can ensure their applications deliver a fast and responsive experience.
Test your knowledge with the following interaction:
This Topic is available in the following Module:
Want to help us improve this content?