...
- an example execution of the endpoint endpoints on the UI,
- how long it took for methods in the requisition service to execute,
- where the endpoint takes endpoints take too much time,
- proposal solutions.
...
Endpoint execution
After clicking "AuthorizeSubmit" we can see the following requests being executed:
The ones worth noting are:
- GET PUT /api/requisitions/<id>, which takes 24.96s
Is this really needed? The requisition was already fetched when entering the product gridtook 22.86s - POST /api/requisitions/<id>/authorizesubmit, 2320.06s54s
This is These are the endpoint endpoints we are interested in. The response contains Their responses contain over 1000 non full supply products and over 230 requisition line items. We will look into what took so long in the next paragraph. - GET /api/requisitions/periodsForInitiate, 1.59s94s
- GET /api/requisitions/search, 1.3m9m
These endpoints are executed when the UI goes back to the previous state (Create/authorize list).
Scalyr also shows a spike in CPU, Network and Disk bandwidth usage:
Methods
The following image presents images present a list of methods that have been used while authorizing saving and submitting the requisition. The request was requests were sent through Swagger UI and no other endpoints were called during that time. The visualvm tool has been used to capture those methods. The tool was configured to capture only methods from org.openlmis package and sub-packages in the requisition service.
Save
Submit
The above example shows that endpoint was executed in 21.40s, most of which (17.70s) was examples show that most of the time was consumed by RequisitionDtoBuilder to construct the response.Getting all orderables from reference data service took another 2,78s.
Code
RequisitionController
...