From c73b8e50b38ee3ff40258bc90e31237e1abd23e2 Mon Sep 17 00:00:00 2001 From: Jayasanka Weerasinghe <33048395+jayasanka-sack@users.noreply.github.com> Date: Thu, 5 Sep 2024 18:25:31 +0300 Subject: [PATCH 1/5] Limit visits to 1 --- .../java/org/openmrs/performance/http/DoctorHttpService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/openmrs/performance/http/DoctorHttpService.java b/src/test/java/org/openmrs/performance/http/DoctorHttpService.java index 3a7707ae..5ae2a4e3 100644 --- a/src/test/java/org/openmrs/performance/http/DoctorHttpService.java +++ b/src/test/java/org/openmrs/performance/http/DoctorHttpService.java @@ -41,7 +41,7 @@ public HttpRequestActionBuilder getVisitsOfPatient(String patientUuid) { + "attributes:(attributeType:ref,display,uuid,value))"; return http("Get Visits of Patient") - .get("/openmrs/ws/rest/v1/visit?patient=" + patientUuid + "&v=" + customRepresentation); + .get("/openmrs/ws/rest/v1/visit?patient=" + patientUuid + "&v=" + customRepresentation+"&limit=1"); } public HttpRequestActionBuilder getActiveVisitOfPatient(String patientUuid) { From a3affd9865424896c124b19758789e4a9990a4e7 Mon Sep 17 00:00:00 2001 From: Jayasanka Weerasinghe <33048395+jayasanka-sack@users.noreply.github.com> Date: Fri, 6 Sep 2024 10:11:42 +0300 Subject: [PATCH 2/5] Limit attributes --- .../org/openmrs/performance/http/DoctorHttpService.java | 9 ++++++++- .../java/org/openmrs/performance/http/HttpService.java | 2 +- .../openmrs/performance/registries/DoctorRegistry.java | 7 +++++-- .../performance/scenarios/VisitPatientScenario.java | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/openmrs/performance/http/DoctorHttpService.java b/src/test/java/org/openmrs/performance/http/DoctorHttpService.java index 5ae2a4e3..3d75d85d 100644 --- a/src/test/java/org/openmrs/performance/http/DoctorHttpService.java +++ b/src/test/java/org/openmrs/performance/http/DoctorHttpService.java @@ -30,6 +30,13 @@ public HttpRequestActionBuilder getVisitTypes() { } public HttpRequestActionBuilder getVisitsOfPatient(String patientUuid) { + String customRepresentation = "custom:(uuid,voided,indication,startDatetime,stopDatetime)"; + + return http("Get Visits of Patient") + .get("/openmrs/ws/rest/v1/visit/?patient=" + patientUuid + "&v=" + customRepresentation+"&limit=5"); + } + + public HttpRequestActionBuilder getVisit(String visitUuid) { String customRepresentation = "custom:(uuid,encounters:(uuid,diagnoses:(uuid,display,rank,diagnosis)," + "form:(uuid,display),encounterDatetime,orders:full," + "obs:(uuid,concept:(uuid,display,conceptClass:(uuid,display)),display," @@ -41,7 +48,7 @@ public HttpRequestActionBuilder getVisitsOfPatient(String patientUuid) { + "attributes:(attributeType:ref,display,uuid,value))"; return http("Get Visits of Patient") - .get("/openmrs/ws/rest/v1/visit?patient=" + patientUuid + "&v=" + customRepresentation+"&limit=1"); + .get("/openmrs/ws/rest/v1/visit/" + visitUuid + "&v=" + customRepresentation); } public HttpRequestActionBuilder getActiveVisitOfPatient(String patientUuid) { diff --git a/src/test/java/org/openmrs/performance/http/HttpService.java b/src/test/java/org/openmrs/performance/http/HttpService.java index 10be4a66..7d9d8196 100644 --- a/src/test/java/org/openmrs/performance/http/HttpService.java +++ b/src/test/java/org/openmrs/performance/http/HttpService.java @@ -61,7 +61,7 @@ public HttpRequestActionBuilder getPrimaryIdentifierTermMapping() { } public HttpRequestActionBuilder getVisitsOfLocation(String locationUuid) { - return http("Get Visits") + return http("Get Visits of a Location") .get("/openmrs/ws/rest/v1/visit?v=custom:(uuid,patient:(uuid,identifiers:(identifier,uuid,identifierType:(name,uuid)),person:(age,display,gender,uuid,attributes:(value,attributeType:(uuid,display)))),visitType:(uuid,name,display),location:(uuid,name,display),startDatetime,stopDatetime)&includeInactive=false&totalCount=true&location=" + locationUuid); } diff --git a/src/test/java/org/openmrs/performance/registries/DoctorRegistry.java b/src/test/java/org/openmrs/performance/registries/DoctorRegistry.java index 27875e27..6f6f16b8 100644 --- a/src/test/java/org/openmrs/performance/registries/DoctorRegistry.java +++ b/src/test/java/org/openmrs/performance/registries/DoctorRegistry.java @@ -108,8 +108,11 @@ public ChainBuilder openAttachmentsTab(String patientUuid) { .exec(httpService.getAllowedFileExtensions()); } - public ChainBuilder openVisitsTab(String patientUuid) { - return exec(httpService.getVisitsOfPatient(patientUuid)); + public ChainBuilder openVisitsTab(String patientUuid, String visitUuid) { + return exec( + httpService.getVisitsOfPatient(patientUuid), + httpService.getVisit(visitUuid) + ); } public ChainBuilder addDrugOrder(String patientUuid, String visitUuid, String currentUserUuid) { diff --git a/src/test/java/org/openmrs/performance/scenarios/VisitPatientScenario.java b/src/test/java/org/openmrs/performance/scenarios/VisitPatientScenario.java index 9d247e4e..cf54f2ef 100644 --- a/src/test/java/org/openmrs/performance/scenarios/VisitPatientScenario.java +++ b/src/test/java/org/openmrs/performance/scenarios/VisitPatientScenario.java @@ -23,7 +23,7 @@ public ScenarioBuilder getScenarioBuilder() { .exec(registry.openHomePage()) .exec(registry.openPatientChartPage("#{patient_uuid}")) .exec(registry.startVisit("#{patient_uuid}")) - .exec(registry.openVisitsTab("#{patient_uuid}")) + .exec(registry.openVisitsTab("#{patient_uuid}", "#{visitUuid}")) .exec(registry.openVitalsAndBiometricsTab("#{patient_uuid}")) .exec(registry.openMedicationsTab("#{patient_uuid}")) .exec(registry.openOrdersTab("#{patient_uuid}")) From cde779894970db32669d370b33df3be472cb79de Mon Sep 17 00:00:00 2001 From: Jayasanka Weerasinghe <33048395+jayasanka-sack@users.noreply.github.com> Date: Fri, 6 Sep 2024 10:14:04 +0300 Subject: [PATCH 3/5] Run for 1 hour --- .github/workflows/run-tests-on-gh.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests-on-gh.yml b/.github/workflows/run-tests-on-gh.yml index 767168a1..66299879 100644 --- a/.github/workflows/run-tests-on-gh.yml +++ b/.github/workflows/run-tests-on-gh.yml @@ -47,7 +47,7 @@ jobs: - name: Update the load configuration for PRS if: github.event_name == 'pull_request' run: | - echo "SIMULATION_PRESET=pull_request" >> $GITHUB_ENV + echo "SIMULATION_PRESET=standard" >> $GITHUB_ENV - name: Update the load configuration for commits if: github.event_name == 'push' From 6dcf247f7be58575c52c132ef0e8ace7c70e19fe Mon Sep 17 00:00:00 2001 From: Jayasanka Weerasinghe <33048395+jayasanka-sack@users.noreply.github.com> Date: Fri, 6 Sep 2024 10:18:56 +0300 Subject: [PATCH 4/5] Run for 200 users --- .github/workflows/run-tests-on-gh.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests-on-gh.yml b/.github/workflows/run-tests-on-gh.yml index 66299879..f6a11ff8 100644 --- a/.github/workflows/run-tests-on-gh.yml +++ b/.github/workflows/run-tests-on-gh.yml @@ -47,7 +47,10 @@ jobs: - name: Update the load configuration for PRS if: github.event_name == 'pull_request' run: | - echo "SIMULATION_PRESET=standard" >> $GITHUB_ENV + echo "SIMULATION_PRESET=dev" >> $GITHUB_ENV + echo "TIER_COUNT=1" >> $GITHUB_ENV + echo "TIER_DURATION_MINUTES=30" >> $GITHUB_ENV + echo "USER_INCREMENT_PER_TIER=200" >> $GITHUB_ENV - name: Update the load configuration for commits if: github.event_name == 'push' From f49d10e6dc01376dd7fe36100fad5a9ebaa4bacb Mon Sep 17 00:00:00 2001 From: Jayasanka Weerasinghe <33048395+jayasanka-sack@users.noreply.github.com> Date: Fri, 6 Sep 2024 10:29:22 +0300 Subject: [PATCH 5/5] Change get visit endpoint name --- .../java/org/openmrs/performance/http/DoctorHttpService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/openmrs/performance/http/DoctorHttpService.java b/src/test/java/org/openmrs/performance/http/DoctorHttpService.java index 3d75d85d..88820e53 100644 --- a/src/test/java/org/openmrs/performance/http/DoctorHttpService.java +++ b/src/test/java/org/openmrs/performance/http/DoctorHttpService.java @@ -47,7 +47,7 @@ public HttpRequestActionBuilder getVisit(String visitUuid) { + "startDatetime,stopDatetime,patient," + "attributes:(attributeType:ref,display,uuid,value))"; - return http("Get Visits of Patient") + return http("Get Visit") .get("/openmrs/ws/rest/v1/visit/" + visitUuid + "&v=" + customRepresentation); }