Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

DHIS2

FHIR

DHIS2 vs FHIR %

Average

0.460583455769

0.305799303586

3350.606313%

Test detailed results

logged on Nov 29Dec 1/ 2022 UTC-7 09:0740:00

Performance Testing for finding

Attempt

DHIS2 API (s)

FHIR API (s)

Improvement (%)

El Salvador, Santa Ana, Santa Ana

Attempt 1

0.

500818

505833

0.

359716

360177

28

40.

1743

44%

Attempt 2

0.

491777

489221

0.

353378

36177

28

35.

1426

23%

Attempt 3

0.

501194

498737

0.

364875

371898

27

34.

1988

11%

Kenya, Nairobi, Dagoretti North

Attempt 1

0.

514793

49637

0.

285152

280708

44

76.

6084

83%

Attempt 2

0.

501061

500309

0.

278943

275099

44

81.

3295

87%

Attempt 3

0.

505827

484024

0.

28871

274949

42

76.

9232

04%

Nigeria, Kaduna State, Ifedayo LGA

Attempt 1

0.

345526

329692

0.

291971

288067

15

14.

4996

45%

Attempt 2

0.

326727

340072

0.

275393

280573

15

21.

7116

21%

Attempt 3

0.

330137

330502

0.

296474

275984

10

19.

1967

75%

Nepal, Banepa, Banepa

Attempt 1

0.

503351

500502

0.

301019

290867

40

72.

197

07%

Attempt 2

0.

505373

49083

0.

285749

289518

43

69.

4578

53%

Attempt 3

0.

500418

503132

0.

288203

293428

42

71.

4075

47%

Overall Average

0.

460583

455769

0.

305799

303586

33

50.

6063

13%

Testing Script

Code Block
languagepy
## 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])/dhis2_performances[-1])*100)
            result4['improvement'] = '{}%'.format(float("{:.2f}".format(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'] = '{}%'.format(float("{:.2f}".format(((result4['dhis2'] - /result4['fhir'])/result4['dhis2']-1)*100)))
results4.append(result4)
print(tabulate(results4, headers='firstrow', tablefmt='pipe'))

...