diff --git a/performance/config.yml b/performance/config.yml old mode 100644 new mode 100755 index 90a022739..010420827 --- a/performance/config.yml +++ b/performance/config.yml @@ -1,4 +1,6 @@ modules: + local: + sequential: true jmeter: properties: base-uri: http://localhost diff --git a/performance/test.sh b/performance/test.sh index 2e8c3a32a..bac8525bc 100755 --- a/performance/test.sh +++ b/performance/test.sh @@ -14,7 +14,7 @@ echo "Running performance tests against: $URL" export BASE_URL="${URL}" docker run --rm -e BASE_URL -v $(pwd):/bzt-configs \ -v $(pwd)/../build/performance-artifacts:/tmp/artifacts \ - blazemeter/taurus:1.10.3 \ + blazemeter/taurus:1.16.35 \ -o modules.jmeter.properties.base-uri="${BASE_URL}" \ -o reporting.2.dump-xml=/tmp/artifacts/stats.xml \ config.yml \ diff --git a/performance/tests/facilities.csv b/performance/tests/facilities.csv new file mode 100644 index 000000000..533463a59 --- /dev/null +++ b/performance/tests/facilities.csv @@ -0,0 +1,150 @@ +e6799d64-d10d-4011-b8c2-0e4d4a3f65ce,HC01 +7938919f-6f61-4d1a-a4dc-923c31e9cd45,HF01 +176c4276-1fb1-4507-8ad2-cdfba0f47445,HC02 +5b39f0fb-5c47-4551-b983-1e30ac6df65d,HC03 +bfe3eac5-9961-4d44-a492-431865bbcb23,HC04 +7fc9bda8-ad8a-468d-8244-38e1918527d5,N003 +4774fc63-a0c8-4a29-a01d-5b6b48632175,N007 +a205764b-3998-4c89-afac-2bc9d737c8d3,N008 +0509f332-a77e-4bfc-921b-11c46a6bbfd2,N010 +19a94b68-e613-4996-9bea-94313e9fa34d,N014 +6115591d-6e74-4b7f-9f80-f19e42494c99,N016 +e21e24ea-2d60-4468-b410-133c51485402,N020 +5146de1c-f089-43ff-8016-3c9e8f36e014,N021 +249fbafc-e934-4068-8452-d92381299c40,N023 +6c0de27e-2705-4183-96fc-0905caa34dc2,N024 +97f7c9fb-4d2f-4501-a4bf-f9c365815c20,N028 +e6673cec-c79c-4111-b67c-9b31a1735e27,N030 +701ee94a-083e-46bb-83b7-d95c3a4c9884,N034 +45870b0b-b77e-446b-beb8-a5061145444a,N052 +0fcab1ac-1ddb-408a-8413-feb5ecfc5dc0,N076 +b25bf57d-43ae-41be-8fa9-6335c6fbe161,N105 +97546f93-ac93-435f-a437-cd629deb7d6d,N036 +d473a46c-24f7-4ed0-84c9-dc8941acbf32,N156 +65abb2fb-25ca-429b-add7-d092774e51b8,N040 +5feb3242-10bb-41ea-ab94-4fb6b95185b8,N042 +f573c829-bf73-49e7-ac7d-c13567dcd6c2,N047 +88f3adf2-a59a-49f5-9d90-6ee1367262dd,N058 +a2d3f399-6862-41ec-9a29-dd41ebd50ed9,N067 +c2051128-f6bf-4d84-a33b-1b360a2d87f9,N080 +63ab622b-9628-4084-8bc5-ced7cf03a01d,N085 +f7453d96-601f-4e98-9081-43bd1362a828,N092 +e9dbb5af-b6a2-45e8-83be-b94117fa0d71,N038 +a7ddecee-5699-450e-bd79-bd1b2d00bbfd,N041 +c0d4d66b-d8e9-47e9-92e6-588c88c97c7c,N045 +0267919e-836e-492f-af36-c8c111baaeab,N048 +3a41fcaa-4c41-4fa4-8b6b-3b209138ff90,N055 +2a536413-1a49-4ea6-a904-a7faca769c16,N061 +5f9c60d8-753a-4d34-9769-d08f6703a8ee,N062 +c5c3706f-2379-4209-aa3e-efd5bba8fad3,N064 +796ed125-dc1a-4e40-9b50-ed46843de019,N068 +52be842d-4d74-434e-b8bb-cb983462a4ee,N077 +8adb4ef8-b7ef-4583-91cd-f99c1e4214c7,N086 +7174e805-4fd7-4ffb-a0d3-dc97452dbe89,N113 +c003b16f-a71c-45e8-84bd-e0bbbebd3aef,N115 +6c741c92-6020-47e4-bbd2-1a13d0028c6b,N119 +2a12b307-cd31-4088-8b2d-b70640eabc3a,N121 +3c415f2c-12ad-48b5-9093-00ab86821202,NIA218 +16f0c39a-e26c-43db-8ec0-80d7097c5b33,CD100 +dfb86f06-0c63-44d4-98ed-c5f66942f301,CD101 +b3191ed4-546b-4ec7-b6ea-41857af06523,CD102 +f897d117-e797-464a-9cb9-4904e38d08cb,CD103 +d5c5b1fd-0450-4849-ab9f-3b9b195d9fea,CD104 +fefa1664-b20d-42aa-944e-8d695f80f89c,CD105 +6d418544-30a7-4472-b95e-221db1f074bb,CD106 +eea64a54-0b49-4b0e-b2f8-ee0e28f62516,CD107 +32f500ea-7fdb-4fe7-9d9b-9ca92a3241ca,CD108 +ceb2d84e-f286-40a0-ab7c-fbef1ae7cba9,CD110 +2fb66ef2-990d-419d-9bfb-213d6513ed7d,CD111 +e9096991-ba3b-4b52-a4a0-92844932c194,CD112 +96ce6a6e-f7a0-4b34-ba67-0382a5524283,CD113 +21070201-0627-429b-a50a-267a27a21825,CD114 +c9d1462d-f6ac-4eb8-bd40-b8a662332217,CD115 +aa8e962a-9978-40a7-8cbb-a5269447dc1a,CD116 +8330d59d-aa99-4679-921d-77cf0acf0b0e,CD117 +71dc9c20-d5a0-446f-83a4-06cb2fd2f6bb,CD119 +77a4555a-a3e0-424d-91a2-19dd057cd88e,CD120 +86954be5-3368-47ed-b464-c044c4619e5e,CD121 +d000d16d-5d37-400f-a79e-0ba4859b1b9c,CD122 +10783adf-d188-4303-abaf-802f90d84f7c,CD123 +4b455b07-1bab-475e-9b58-5f5dd15ab8d6,CD124 +5a4dc064-d0cc-436c-8a37-e627c37fcdfe,CD139 +8cb1a806-c17b-4c4c-8956-694953dd785b,CD140 +8ccf24ee-c988-4e66-b4f0-b1520db520c7,CD142 +bf27f50f-80a0-4c02-a3a6-3655d3f23be2,CD143 +1e846e0f-cc24-4e85-911a-0d46946b0787,CD144 +52b1e1a3-9b93-4816-9212-54c9ecf821c5,CD145 +7aafab6a-0468-43c4-b644-18436e2248c1,CD146 +58afe49c-1bfc-4e6d-8ce3-5958f21831c9,CD148 +8c1fe340-1266-4c5f-9d42-a9e9c622f470,CD156 +2b1e2e2c-8571-4d7d-9e70-6c51582fdd3e,CD157 +d28f984d-e599-4b67-b26a-aea3f2f7ae81,CD160 +37555584-7eba-4050-a97f-9742aef1c2b9,CD161 +3a3e1b7e-3d68-4ed0-a1ab-d9d555899429,CD162 +736b7ab6-5cf5-46f2-a7e2-61ae1f694f02,CD168 +4d01266f-8576-4e02-800d-61977f9c2ec0,CD172 +29158ce8-3e99-4dea-9ec5-3379d7a67c40,CD173 +9c9ff6b9-b198-42b9-9dab-72e3aaddd607,CD174 +46fdc45b-4884-45a8-98a9-ee1bcee62b41,CD179 +dac0ed57-5a4f-45ab-946d-7743ae7d9b07,CD180 +2c5ed36f-9976-4508-8c71-14c39759e3fc,CD184 +6dc0e3a3-4bb3-4d88-9c62-2ab8024f9fd7,CD185 +00e640c7-5f34-4286-bb4b-b8f5f304085f,CD186 +3dcd3889-32f1-4ba8-b15c-a67d9e300ca6,CD189 +51b535ce-9938-41ef-bcbd-dac029f0568f,CD190 +33925176-5356-4818-a7cc-351d112310c6,CD191 +c22a2ca5-6b59-4fc9-8774-8f58225ef948,CD195 +ca7c5025-8942-427b-a08f-a4b53638bf7c,CD196 +140684b4-d8a1-4857-8cda-febddf79f3b0,CD200 +f022c9b8-971d-43ea-b708-45eb9a95f686,CD201 +f1e48f07-b7fc-4271-a91c-0608d955b3e7,CD202 +dcf517ab-1486-46b3-9db5-add0d9719f1d,CD205 +35183daa-801e-4476-b815-c9d50ba11b6e,CD206 +0cea4bcc-e10e-4cac-8da9-8721bc371237,CD210 +8b1a2402-b57b-4d16-80e1-795e0c19719d,CD211 +6cd358d1-c19e-47f6-85a9-291fd959b7e6,CD238 +e3e292cf-2985-4f2f-897c-9de18e580c57,CD239 +89b9b877-578d-4401-ad3b-4e0a110874d6,CD240 +36a5d9a9-3832-44d9-bcfb-ac226dbdc359,CD241 +020293fa-1dc8-4ef1-af1e-0cae28f3d702,CD242 +609712df-cbc3-4efb-bad0-80a0bb80b7a6,CD243 +94205b1b-1227-4207-8f3c-8a7138aa9730,G100 +811b97a5-1613-4e45-8fc2-2df70b9fc39c,G101 +960d3010-c3f6-4817-a133-3222443605d0,G102 +7c197d2b-3775-43ac-b2d6-0d8e6205bfb4,G103 +b739f278-6660-4656-945b-31e3b71787f0,G104 +865f6762-22cc-45aa-b2f5-e93911c9c4e2,G106 +813659fb-c254-4e94-82cf-d302ec2f68ba,G107 +3b7b59ea-aac5-4783-9ddf-c9d67cad8bdf,G109 +4af26620-b7c6-4641-b054-91f0278d1900,G110 +637e28f9-2bdf-41f4-bb2e-30597ff25f1a,G112 +99f705a0-be31-43fd-9a8a-3256a37bdbe5,G113 +b52a042e-c249-46bb-9483-c02ba885c048,G114 +094ef038-a74e-4ed8-b01d-9322d3a49d28,G115 +b20ecdc2-dc0b-4b36-b734-4c305e6753f1,P2roOcSC37 +1ba5a167-1b56-4c3a-94b0-f7655c1cf07c,G116 +09ab1a35-a208-4bad-b4bf-fe2b95b442d8,G117 +d0f190de-005e-481b-8693-187d4a152a95,G118 +670b258f-8e94-48dd-9029-6290e21d69b5,G119 +2dfc8590-c595-4a16-ae7c-1cfbfc129781,G120 +ff86091a-44a5-4150-8fa6-e0deee421f6d,G121 +ab6c4a31-867b-401f-adea-8c8158ba160e,G122 +9cd30742-de59-4d43-ae56-dec71380de4b,G123 +db8678e0-74ba-4a21-bdc3-d563b7fdacbc,G124 +34b3242d-a8e7-426d-a95f-1a929db4168c,G125 +14120154-49f6-48dd-a43d-166e8a539c86,G126 +c5e9bbcb-b316-4461-9381-9fa86fe6d459,G127 +3704c1c2-48eb-4089-97a5-a35136236faf,G128 +3ef318eb-e5e6-4459-86b0-bd50f123c719,G129 +bb2f9df6-5194-4acd-82a3-2c447dd8a59f,G130 +72118a5d-6355-4aeb-ad6e-8af5d3ae290c,G131 +44756631-ec5b-4417-a62f-9cc543c0d8da,G145 +3df42692-11c0-4341-90c2-bbf4e4e40154,G146 +2182c40f-28dc-4764-a7cf-fb6598036e10,G147 +33144390-7e6c-46f4-9e54-f95a820b2343,G148 +d1320788-2e2e-4a2c-9991-3df09db80313,G149 +84b20c6b-4329-4027-b4ab-3b9d7935c92a,G150 +a8a72c6f-976e-4c07-a352-f4a6677e8303,G151 +af313625-bf95-4af7-b2cb-fd4cecb4a3b6,G152 +cc20df1d-0023-4c45-a267-21a3cca0ee5c,G153 +97978978-f521-4d1f-a1b1-90eacb137a07,G161 \ No newline at end of file diff --git a/performance/tests/requisition.yml b/performance/tests/requisition.yml old mode 100644 new mode 100755 index 209091e03..778d5570e --- a/performance/tests/requisition.yml +++ b/performance/tests/requisition.yml @@ -1,15 +1,22 @@ execution: - - concurrency: 1 + - concurrency: 10 iterations: 10 scenario: requisition-workflow - - concurrency: 1 - hold-for: 2m + - concurrency: 150 + ramp-up: 10m + hold-for: 50m + scenario: requisition-workflow + - concurrency: 10 + iterations: 10 + scenario: requisition-workflow + - concurrency: 10 + iterations: 10 scenario: search-one-page - - concurrency: 1 - hold-for: 2m + - concurrency: 10 + iterations: 10 scenario: get-requisitions-for-approval - - concurrency: 1 - hold-for: 2m + - concurrency: 10 + iterations: 10 scenario: get-requisitions-for-convert scenarios: @@ -150,6 +157,7 @@ scenarios: label: RejectRequisition headers: Authorization: Bearer ${access_token} + Content-Type: application/json approve-requisition: requests: - url: ${__P(base-uri)}/api/requisitions/${requisition_id}/approve @@ -171,16 +179,32 @@ scenarios: jsr223: script-text: | import groovy.json.JsonSlurper; + + // Get the requisition ID from variables def requisitionId = vars.get("requisition_id"); def response = prev.getResponseDataAsString(); def jsonSlurper = new JsonSlurper(); def page = jsonSlurper.parseText(response); + + // Log the response to verify what is returned + log.info("Response from requisitionsForConvert: " + response); + + // Check if the requisition ID matches and extract supplying depots def found = page.content.find { elem -> return requisitionId.equals(elem.requisition.id); + }; + + if (found != null && found.supplyingDepots != null && !found.supplyingDepots.isEmpty()) { + def depotId = found.supplyingDepots.first().id; + log.info("Found supplying depot ID: " + depotId); + + // Create the convert form + def form = "{\"createOrder\": true, \"requisitionsToRelease\": [{ \"requisitionId\": \"" + requisitionId + "\", \"supplyingDepotId\": \"" + depotId + "\"}]}"; + vars.put("convert_form", form); + } else { + log.error("No supplying depots found for requisition ID: " + requisitionId); } - def depotId = found.supplyingDepots.first().id; - def form = "{\"createOrder\": true, \"requisitionsToRelease\": [{ \"requisitionId\": \"" + requisitionId + "\", \"supplyingDepotId\": \"" + depotId + "\"}]}"; - vars.put("convert_form", form); + convert-to-order: requests: - url: ${__P(base-uri)}/api/requisitions/batchReleases @@ -201,12 +225,9 @@ scenarios: variables: # Family Planning program_id: dce17f2e-af3e-40ad-8e00-3496adef44c3 - # Nandumbo Health Center - facility_id: 176c4276-1fb1-4507-8ad2-cdfba0f47445 - facility_code: HC02 - emergency: false - # SCH001 schedule_id: 9c15bd6e-3f6b-4b91-b53a-36c199d35eac + emergency: false + think-time: ~45s requests: - include-scenario: get-user-token - include-scenario: get-period-for-initiate @@ -222,7 +243,16 @@ scenarios: - include-scenario: approve-requisition - include-scenario: get-supplying-depot - include-scenario: convert-to-order + data-sources: # list of external data sources + - path: facilities.csv # this is a full form + delimiter: ',' + quoted: false + encoding: "utf-8" + loop: true + variable-names: facility_id,facility_code + random-order: false search-one-page: + think-time: ~60s requests: - include-scenario: get-user-token - url: ${__P(base-uri)}/api/requisitions/search?page=0&size=10 @@ -232,6 +262,7 @@ scenarios: Authorization: Bearer ${access_token} Content-Type: application/json get-requisitions-for-approval: + think-time: ~60s requests: - include-scenario: get-user-token - url: ${__P(base-uri)}/api/requisitions/requisitionsForApproval?page=0&size=10 @@ -241,6 +272,7 @@ scenarios: Authorization: Bearer ${access_token} Content-Type: application/json get-requisitions-for-convert: + think-time: ~60s requests: - include-scenario: get-user-token - url: ${__P(base-uri)}/api/requisitions/requisitionsForConvert?page=0&size=10 @@ -251,17 +283,48 @@ scenarios: Content-Type: application/json reporting: - - module: passfail - criteria: - 90% of get requisition for convert fail to get in 5000 milliseconds: p90 of GetAPageOfTenRequisitionsForConvert>5000ms - 90% of get periods for initiate fail to get in 7000 milliseconds: p90 of GetPeriodsForInitiate>7000ms - 90% of initiate requisition fail to get in 15000 milliseconds: p90 of InitiateRequisition>15000ms - 90% of get requisition to update fail to get in 5000 milliseconds: p90 of GetRequisitionToUpdate>5000ms - 90% of update requisition fail to get in 3000 milliseconds: p90 of UpdateRequisition>3000ms - 90% of submit requisition fail to get in 2000 milliseconds: p90 of SubmitRequisition>2000ms - 90% of authorize requisition fail to get in 5000 milliseconds: p90 of AuthorizeRequisition>5000ms - 90% of reject requisition fail to get in 10000 milliseconds: p90 of RejectRequisition>10000ms - 90% of approve requisition fail to get in 60000 milliseconds: p90 of ApproveRequisition>70000ms - 90% of get supplying depot for facility fail to get in 8000 milliseconds: p90 of GetSupplyingDepotForFacility>8000ms - 90% of convert requisition to order fail to get in 20000 milliseconds: p90 of ConvertRequisitionToOrder>20000ms - 90% of delete requisition fail to get in 5000 milliseconds: p90 of DeleteRequisition>5000ms \ No newline at end of file + - module: passfail + criteria: + - 'p90<=5000ms, continue as passed, label=GetPeriodsForInitiate, title="Get Periods for Initiate is successful"' + - 'p90>5000ms and p90<=7000ms, continue as passed, label=GetPeriodsForInitiate, title="Get Periods for Initiate needs improvement"' + - 'p90>7000ms, continue as failed, label=GetPeriodsForInitiate, title="Get Periods for Initiate is too high"' + + - 'p90<=10000ms, continue as passed, label=InitiateRequisition, title="Initiate Requisition is successful"' + - 'p90>10000ms and p90<=15000ms, continue as passed, label=InitiateRequisition, title="Initiate Requisition needs improvement"' + - 'p90>15000ms, continue as failed, label=InitiateRequisition, title="Initiate Requisition is too high"' + + - 'p90<=3000ms, continue as passed, label=GetRequisitionToUpdate, title="Get Requisition to Update is successful"' + - 'p90>3000ms and p90<=5000ms, continue as passed, label=GetRequisitionToUpdate, title="Get Requisition to Update needs improvement"' + - 'p90>5000ms, continue as failed, label=GetRequisitionToUpdate, title="Get Requisition to Update is too high"' + + - 'p90<=2000ms, continue as passed, label=UpdateRequisition, title="Update Requisition is successful"' + - 'p90>2000ms and p90<=3000ms, continue as passed, label=UpdateRequisition, title="Update Requisition needs improvement"' + - 'p90>3000ms, continue as failed, label=UpdateRequisition, title="Update Requisition is too high"' + + - 'p90<=1500ms, continue as passed, label=SubmitRequisition, title="Submit Requisition is successful"' + - 'p90>1500ms and p90<=2000ms, continue as passed, label=SubmitRequisition, title="Submit Requisition needs improvement"' + - 'p90>2000ms, continue as failed, label=SubmitRequisition, title="Submit Requisition is too high"' + + - 'p90<=3000ms, continue as passed, label=AuthorizeRequisition, title="Authorize Requisition is successful"' + - 'p90>3000ms and p90<=5000ms, continue as passed, label=AuthorizeRequisition, title="Authorize Requisition needs improvement"' + - 'p90>5000ms, continue as failed, label=AuthorizeRequisition, title="Authorize Requisition is too high"' + + - 'p90<=7000ms, continue as passed, label=RejectRequisition, title="Reject Requisition is successful"' + - 'p90>7000ms and p90<=10000ms, continue as passed, label=RejectRequisition, title="Reject Requisition needs improvement"' + - 'p90>10000ms, continue as failed, label=RejectRequisition, title="Reject Requisition is too high"' + + - 'p90<=50000ms, continue as passed, label=ApproveRequisition, title="Approve Requisition is successful"' + - 'p90>50000ms and p90<=70000ms, continue as passed, label=ApproveRequisition, title="Approve Requisition needs improvement"' + - 'p90>70000ms, continue as failed, label=ApproveRequisition, title="Approve Requisition is too high"' + + - 'p90<=5000ms, continue as passed, label=GetSupplyingDepotForFacility, title="Get Supplying Depot is successful"' + - 'p90>5000ms and p90<=8000ms, continue as passed, label=GetSupplyingDepotForFacility, title="Get Supplying Depot needs improvement"' + - 'p90>8000ms, continue as failed, label=GetSupplyingDepotForFacility, title="Get Supplying Depot is too high"' + + - 'p90<=15000ms, continue as passed, label=ConvertRequisitionToOrder, title="Convert Requisition to Order is successful"' + - 'p90>15000ms and p90<=20000ms, continue as passed, label=ConvertRequisitionToOrder, title="Convert Requisition to Order needs improvement"' + - 'p90>20000ms, continue as failed, label=ConvertRequisitionToOrder, title="Convert Requisition to Order is too high"' + + - 'p90<=3000ms, continue as passed, label=DeleteRequisition, title="Delete Requisition is successful"' + - 'p90>3000ms and p90<=5000ms, continue as passed, label=DeleteRequisition, title="Delete Requisition needs improvement"' + - 'p90>5000ms, continue as failed, label=DeleteRequisition, title="Delete Requisition is too high"' diff --git a/performance/tests/requisitionBatchApproval.yml b/performance/tests/requisitionBatchApproval.yml old mode 100644 new mode 100755 diff --git a/performance/tests/users.csv b/performance/tests/users.csv new file mode 100644 index 000000000..43f904742 --- /dev/null +++ b/performance/tests/users.csv @@ -0,0 +1,3 @@ +administrator,password +administrator,password +administrator,password