...
DHIS2 | FHIR | DHIS2 vs FHIR % | ||
---|---|---|---|---|
Average | 0.552877 554281 | 0.552823555023 | 100-0.84613% |
Test detailed results
logged on Nov 22Dec 1/ 2022 UTC-7 2008:5040:00
Performance Testing for | Attempt | DHIS2 API | FHIR API | FHIR API (with HealthcareServices), | Improvement |
---|
% |
---|
El Salvador | Attempt - 1 | 0. |
566667 | 0. |
488375 | 0. |
487989 |
16. |
03% | ||
Attempt - 2 | 0. |
532607 | 0. |
437886 | 0. |
548295 |
21. |
63% | ||
Attempt - 3 | 0. |
532142 | 0. |
452103 | 0. |
463129 |
17. |
Average
0.526901
0.463208
0.491861
113.856
7% | ||
Kenya | Attempt - 1 | 0. |
657443 | 0. |
604362 | 0. |
625961 |
8. |
78% | ||
Attempt - 2 | 0. |
655574 | 0. |
578361 | 0. |
574557 |
13. |
35% | ||
Attempt - 3 | 0. |
659164 | 0. |
573111 | 0. |
663475 |
115.895
Average
0.668913
0.566106
0.665437
118.22
15.02% | ||
Nigeria | Attempt - 1 | 0. |
526847 | 0. |
570136 | 0. |
651838 |
-7. |
59% | ||
Attempt - 2 | 0. |
528978 | 0. |
588868 | 0. |
620271 |
-10. |
17% | ||
Attempt - 3 | 0. |
536548 | 0. |
568277 | 0. |
70342 |
89.0077
Average
0.537195
0.583614
0.739619
-5.58% | ||
Cameroon | Attempt - 1 | 0. |
372636 | 0. |
587497 | 0. |
590178 |
-36. |
57% | ||
Attempt - 2 | 0. |
371032 | 0. |
584348 | 0. |
595724 |
-36. |
5% | ||
Attempt - 3 | 0. |
371502 | 0. |
558964 | 0. |
585595 |
61.3056
Average
0.370299
0.583081
0.705694
-33.54% | ||
Nepal | Attempt - 1 | 0. |
662525 | 0. |
612458 | 0. |
682753 |
8. |
17% | ||
Attempt - 2 | 0. |
670834 | 0. |
56743 | 0. |
571592 |
18. |
22% | ||
Attempt - 3 | 0. |
669719 | 0. |
553174 | 0. |
584597 |
21. |
07% | ||
Overall Average | 0. |
554281 | 0. |
555023 | 0. |
116.481
Overall Average
0.552877
0.552823
0.664025
596625 | -0.13% |
Testing Script
Code Block | ||||
---|---|---|---|---|
| ||||
##Case 1 case_1_results = [{"description": "Performance Testing for", "attempt": "Attempt", "dhis2": "DHIS2 API", "fhir": "FHIR API", "fhir_with_healthcareServices": "FHIR API (with HealthcareServices),", "improvement":"Improvement %"}] print("Case #1 - Getting 500 orgUnits/Location in the country (by ISO)") dhis2_overall_averageimprovements = 0[] fhirdhis2_overall_averageperformances = 0[] fhir_hcshsc_overall_averageperformances = 0[] improvementfhir_overallperformances = 0[] for country in countries: dhis2_section_sum = 0 fhir_section_sum = 0 fhir_hcs_section_sum = 0 improvement_section_sum = 0 for i in range(1,4): case_1_result = {} if i == 1: case_1_result['description'] = "{}".format(country['name']) case_1_result['attempt'] = "Attempt - {}".format(i) dhis2_url = dhis2_base_url+'iso2={}&number=500'.format(country['code']) result = requests.get(dhis2_url, auth=dhis2_auth) if result.status_code == 200: dhis2_performances.append(result.elapsed.total_seconds()) case_1_result['dhis2'] = result.elapsed.total_seconds()dhis2_performances[-1] request_url = fhir_location_url+'address-country={}&_count=500'.format(country['name']) fhirResult = requests.get(request_url, auth=fhir_auth) if fhirResult.status_code == 200: fhir_performances.append(fhirResult.elapsed.total_seconds()) case_1_result['fhir'] = fhirResult.elapsed.total_seconds()fhir_performances[-1] request_healthcare_url = fhir_location_url+'address-country={}&_count=500&_revinclude=HealthcareService:location'.format(country['name']) fhirHealthcareServicesResult = requests.get(request_healthcare_url, auth=fhir_auth) if fhirHealthcareServicesResult.status_code == 200: case_1_result['fhir_with_healthcareServices'] = hsc_performances.append(fhirHealthcareServicesResult.elapsed.total_seconds()) case_1_result['improvementfhir_with_healthcareServices'] = (casefhir_1hsc_result['dhis2'] / case_1_result['fhir'])*100performances[-1] case_1_results.append(case_1_result) dhis2_section_sum += improvements.append(((case_1_result['dhis2'] fhir_section_sum +=/ case_1_result['fhir']) - 1)*100) fhir_hcs_section_sum += case_1_result['fhir_with_healthcareServices']'improvement'] = '{}%'.format(float("{:.2f}".format(improvements[-1]))) improvementcase_section_sum += 1_results.append(case_1_result['improvement']) time.sleep(1) 0.01) case_1_result = {} case_1_result['attemptdescription'] = "Overall Average" case_1_result['dhis2'] = np.average(dhis2_section_sum / 3 performances) case_1_result['fhir'] = np.average(fhir_section_sum / 3 performances) case_1_result['fhir_with_healthcareServices'] = np.average(fhir_hcs_section_sum / 3 hsc_performances) case_1_result['improvement'] = improvement_section_sum / 3 case_1_results.append(case_1_result) dhis2_overall_average += dhis2_section_sum / 3 fhir_overall_average += fhir_section_sum / 3 fhir_hcs_overall_average += fhir_hcs_section_sum / 3 improvement_overall += improvement_section_sum / 3 case_1_result = {} case_1_result['description'] = "Overall Average" '{}%'.format(float("{:.2f}".format(((case_1_result['dhis2'] = dhis2_overall_average / nos_countries case_1_result['fhir'] = fhir_overall_average / nos_countries case_1_result['fhir_with_healthcareServices'] = fhir_hcs_overall_average / nos_countries case_1_result['improvement'] = improvement_overall / nos_countries )-1)*100))) case_1_results.append(case_1_result) print(tabulate(case_1_results, headers='firstrow', tablefmt='fancy_gridpipe')) |