Finding Specific orgUnits / Location by area and SubArea
Searching for specific outlets or locations that exists in the specific area and subareas.
Summary of test results
DHIS2 | FHIR | DHIS2 vs FHIR % | ||
---|---|---|---|---|
Average | 0.468058 | 0.304159 | 154.803 |
Test detailed results
logged on Nov 22/ 2022 UTC-7 21:38:00
Performance Testing for finding | Attempt | DHIS2 API (s) | FHIR API (s) | Improvement (%) |
---|---|---|---|---|
El Salvador, Santa Ana, Santa Ana | Attempt 1 | 0.511257 | 0.366876 | 139.354 |
Attempt 2 | 0.509355 | 0.360223 | 141.4 | |
Attempt 3 | 0.522452 | 0.359657 | 145.264 | |
Kenya, Nairobi, Dagoretti North | Attempt 1 | 0.507172 | 0.285228 | 177.813 |
Attempt 2 | 0.523098 | 0.280332 | 186.599 | |
Attempt 3 | 0.500746 | 0.282245 | 177.415 | |
Nigeria, Kaduna State, Ifedayo LGA | Attempt 1 | 0.341146 | 0.285766 | 119.379 |
Attempt 2 | 0.33383 | 0.2955 | 112.971 | |
Attempt 3 | 0.334494 | 0.276497 | 120.976 | |
Nepal, Banepa, Banepa | Attempt 1 | 0.510542 | 0.28096 | 181.713 |
Attempt 2 | 0.514676 | 0.285235 | 180.439 | |
Attempt 3 | 0.507931 | 0.291392 | 174.312 | |
Overall Average | 0.468058 | 0.304159 | 154.803 |
Testing Script
## Case #4 results4 = [{"description": "Performance Testing for finding","attempt": "Attempt", "dhis2": "DHIS2 API (s)", "fhir": "FHIR API (s)", "improvement": "Improvement (%)"}] print("Case #4 - Measuring time taken to find outlets in area & subArea") improvements = [] dhis2_performances = [] fhir_performances = [] for country in countries: if country['name'] != "Cameroon": for i in range (1,4): result4 = {} if i == 1: result4['description'] = "{}, {}, {}".format(country['name'], country['area'], country['subArea']) result4['attempt'] = "Attempt {}".format(i) dhis2_url = dhis2_base_url+'area={}&areaSub={}'.format(country['area'], country['subArea']) result = requests.get(dhis2_url, auth=dhis2_auth) if result.status_code == 200: dhis2_performances.append(result.elapsed.total_seconds()) result4['dhis2'] = dhis2_performances[-1] request_url = fhir_location_url+'address={}&address-city={}&_count=500'.format(country['area'], country['subArea']) fhirResult = requests.get(request_url, auth=fhir_auth) if fhirResult.status_code == 200: fhir_performances.append(fhirResult.elapsed.total_seconds()) result4['fhir'] = fhir_performances[-1] improvements.append((dhis2_performances[-1]/fhir_performances[-1])*100) result4['improvement'] = improvements[-1] results4.append(result4) time.sleep(0.01) result4 = {} result4['description'] = "Overall Average" result4['dhis2'] = Average(dhis2_performances) result4['fhir'] = Average(fhir_performances) result4['improvement'] = Average(improvements) results4.append(result4) print(tabulate(results4, headers='firstrow', tablefmt='html'))