...
DHIS2 | FHIR | DHIS2 vs FHIR % | |
---|---|---|---|
Average | 0.551962547128 | 0.358791355352 | 15653.47897% |
Test detailed results
logged on Nov 22Dec 1/ 2022 UTC-7 2110:5100:00
Performance Testing for Outlet Type | Attempt | DHIS2 API (s) | FHIR API (s) | Improvement (%) |
---|---|---|---|---|
Dominican Republic | Attempt - 1 | 0. |
571623 | 0. |
332961 |
71. |
68% | ||
Attempt - 2 | 0. |
522887 | 0. |
288102 |
81. |
49% | ||
Attempt - 3 | 0. |
534688 | 0. |
274596 |
94. |
72% | ||
Honduras | Attempt - 1 | 0. |
53421 | 0. |
366531 |
45. |
75% | ||
Attempt - 2 | 0. |
540515 | 0. |
350941 |
54. |
02% | ||
Attempt - 3 | 0. |
530475 | 0. |
362607 |
46. |
29% | ||
Vietnam | Attempt - 1 | 0. |
566133 | 0. |
431809 |
31. |
11% | ||
Attempt - 2 | 0. |
565934 | 0. |
390195 |
45. |
04% | ||
Attempt - 3 | 0. |
55769 | 0. |
400428 |
39. |
27% | ||
Overall Average | 0. |
547128 | 0. |
355352 |
53. |
97% |
Testing Script
Code Block | ||
---|---|---|
| ||
results7 = [{"description": "Performance Testing for Outlet Type", "attempt": "Attempt", "dhis2": "DHIS2 API (s)", "fhir": "FHIR API (s)", "improvement": "Improvement (%)"}] print("Case #7 - Measuring time taken to find outlet / location by Type") countries = [ {"iso2": "do", "name": "Dominican Republic", "type": "Farmacia", "code": 18102}, {"iso2": "HN", "name": "Honduras", "type": "Farmacia", "code": 18102},{"iso2": "VN", "name": "Vietnam", "type": "Pharmacy", "code": 18102}] improvements = [] dhis2_performances = [] fhir_performances = [] for country in countries: for i in range(1,4): result7 = {} if i == 1: result7['description'] = "{}".format(country['name']) result7['attempt'] = "Attempt - {}".format(i) dhis2_url = dhis2_base_url+'iso2={}&type={}&n=100'.format(country['iso2'], country['type']) result = requests.get(dhis2_url, auth=dhis2_auth) if result.status_code == 200: dhis2_performances.append(result.elapsed.total_seconds()) result7['dhis2'] = dhis2_performances[-1] request_url = fhir_location_url+'address-country={}&type={}&_count=100'.format(country['name'], country['code']) fhirResult = requests.get(request_url, auth=fhir_auth) if fhirResult.status_code == 200: fhir_performances.append(fhirResult.elapsed.total_seconds()) result7['fhir'] = fhir_performances[-1] improvements.append(((dhis2_performances[-1]/fhir_performances[-1])-1)*100) result7['improvement'] = '{}%'.format(float("{:.2f}".format(improvements[-1]))) results7.append(result7) time.sleep(0.01) result7 = {} result7['description'] = "Overall Average" result7['dhis2'] = np.average(dhis2_performances) result7['fhir'] = np.average(fhir_performances) result7['improvement'] = np.average(improvements'{}%'.format(float("{:.2f}".format(((result7['dhis2']/result7['fhir'])-1)*100))) results7.append(result7) print(tabulate(results7, headers='firstrow', tablefmt='pipe')) |