Versions Compared

Key

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

...

DHIS2

FHIR

DHIS2 vs FHIR %

Average

0.468058455769

0.304159 303586

15450.80313%

Test detailed results

logged on Nov 22Dec 1/ 2022 UTC-7 2109:3840:00

Performance Testing for finding

Attempt

DHIS2 API (s)

FHIR API (s)

Improvement (%)

El Salvador, Santa Ana, Santa Ana

Attempt 1

0.

511257

505833

0.

366876

360177

139

40.

354

44%

Attempt 2

0.

509355

489221

0.

360223

36177

141

35.

4

23%

Attempt 3

0.

522452

498737

0.

359657

371898

145

34.

264

11%

Kenya, Nairobi, Dagoretti North

Attempt 1

0.

507172

49637

0.

285228

280708

177

76.

813

83%

Attempt 2

0.

523098

500309

0.

280332

275099

186

81.

599

87%

Attempt 3

0.

500746

484024

0.

282245

274949

177

76.

415

04%

Nigeria, Kaduna State, Ifedayo LGA

Attempt 1

0.

341146

329692

0.

285766

288067

119

14.

379

45%

Attempt 2

0.

33383

340072

0.

2955

280573

112

21.

971

21%

Attempt 3

0.

334494

330502

0.

276497

275984

120

19.

976

75%

Nepal, Banepa, Banepa

Attempt 1

0.

510542

500502

0.

28096

290867

181

72.

713

07%

Attempt 2

0.

514676

49083

0.

285235

289518

180

69.

439

53%

Attempt 3

0.

507931

503132

0.

291392

293428

174

71.

312

47%

Overall Average

0.

468058

455769

0.

304159

303586

154

50.

803

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])-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'] = Average(improvements'{}%'.format(float("{:.2f}".format(((result4['dhis2']/result4['fhir'])-1)*100)))
results4.append(result4)
print(tabulate(results4, headers='firstrow', tablefmt='htmlpipe'))