# HG changeset patch # User am@osimis.io # Date 1534857645 -7200 # Node ID 1ff0d830bb874c78278f4d8654322d7ca8c4df13 # Parent ff939d07989fb84b36af6bbc0b0bb4b6b8db327c find 100 results diff -r ff939d07989f -r 1ff0d830bb87 PerfsDb/DbPopulator.py --- a/PerfsDb/DbPopulator.py Mon Aug 20 15:50:47 2018 +0200 +++ b/PerfsDb/DbPopulator.py Tue Aug 21 15:20:45 2018 +0200 @@ -60,6 +60,10 @@ startTime = time.time() # first add data that are the same in small and large DBs (and that can be used in tests for comparing the same things !!) + # used in TestFindStudyByPatientId100Results + for i in range(100): + self.createStudy(studyIndex=199000+i, patientIndex=99997, seriesCount=1, instancesPerSeries=1) + # used in TestFindStudyByPatientId5Results self.createStudy(studyIndex=99994, patientIndex=99998, seriesCount=1, instancesPerSeries=1) self.createStudy(studyIndex=99995, patientIndex=99998, seriesCount=1, instancesPerSeries=1) @@ -72,9 +76,9 @@ # used in TestToolsFindStudyByStudyInstanceUID self.createStudy(studyIndex=99999, patientIndex=99999, seriesCount=1, instancesPerSeries=1) - with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "Results/db-init-" + label), 'w', newline='') as resultFile: + with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "Results/db-init-" + label + ".csv"), 'w', newline='') as resultFile: resultWriter = csv.writer(resultFile) - resultWriter.writerow(["patientCount", "filesCount", "duration", "files/sec"]) + resultWriter.writerow(["#patientCount", "filesCount", "files/sec"]) # then, add data to make the DB "large" or "small" for patientIndex in range(0, patientCount): studyIndex=0 @@ -99,8 +103,7 @@ )) resultWriter.writerow([ patientIndex, - self._fileCounter - fileCounterAtPatientStart, - endTimePatient - startTimePatient, + self._fileCounter, (self._fileCounter - fileCounterAtPatientStart)/(endTimePatient - startTimePatient) ]) resultFile.flush() diff -r ff939d07989f -r 1ff0d830bb87 PerfsDb/Run.py --- a/PerfsDb/Run.py Mon Aug 20 15:50:47 2018 +0200 +++ b/PerfsDb/Run.py Tue Aug 21 15:20:45 2018 +0200 @@ -53,6 +53,7 @@ TestFindStudyByStudyDescription0Results(), TestFindStudyByPatientId0Results(), TestFindStudyByPatientId5Results(), + TestFindStudyByPatientId100Results(), TestUploadNextPatientFile(), TestUploadFirstPatientFile(), TestUploadLargeFile10MB(), diff -r ff939d07989f -r 1ff0d830bb87 PerfsDb/Tests/FindStudy.py --- a/PerfsDb/Tests/FindStudy.py Mon Aug 20 15:50:47 2018 +0200 +++ b/PerfsDb/Tests/FindStudy.py Tue Aug 21 15:20:45 2018 +0200 @@ -48,4 +48,14 @@ def test(self): self._orthanc.studies.query( query = {"PatientID": "99998"} + ) + +class TestFindStudyByPatientId100Results(Test): + + def __init__(self, name:str = "FindStudyByPatientId100Results"): + super().__init__(name) + + def test(self): + self._orthanc.studies.query( + query = {"PatientID": "99997"} ) \ No newline at end of file