# HG changeset patch # User am@osimis.io # Date 1534773047 -7200 # Node ID ff939d07989fb84b36af6bbc0b0bb4b6b8db327c # Parent 53575aa2614bad302b3c5ca6a0740e91f2d42198 saving results diff -r 53575aa2614b -r ff939d07989f PerfsDb/README.md --- a/PerfsDb/README.md Mon Aug 20 14:54:32 2018 +0200 +++ b/PerfsDb/README.md Mon Aug 20 15:50:47 2018 +0200 @@ -23,6 +23,7 @@ ------------- - install standard tools + ```bash sudo apt-get install -y mercurial wget curl ``` @@ -77,9 +78,19 @@ ``` -Filtering tests ---------------- +Command line options +-------------------- + ```bash -python Run.py --orthanc-path=/.../ --plugins-path=/.../ --run --pg9-tiny test-filter=*ByPatient* +--clear to clear the DB +--init to initialize the DB +--run to run the tests + +--config to include the config in the test run/init/clear +--orthanc-path path to the folder where the Orthanc execuble lies +--plugins-path path to the folder where the Orthanc plugins lie + +--test-filter=*ByPatient* to filter the tests to execute +--repeat=20 to repeate each test N times (default is 20) ``` \ No newline at end of file diff -r 53575aa2614b -r ff939d07989f PerfsDb/Run.py --- a/PerfsDb/Run.py Mon Aug 20 14:54:32 2018 +0200 +++ b/PerfsDb/Run.py Mon Aug 20 15:50:47 2018 +0200 @@ -1,5 +1,8 @@ import argparse import fnmatch +import csv +import datetime +import os from ConfigFileBuilder import ConfigFileBuilder from TestConfig import TestConfig @@ -149,16 +152,30 @@ resultsByTestName[result.name] = {} resultsByTestName[result.name][configName] = result -headerLine = "{empty:<40}|".format(empty="") -for testConfig in selectedTestConfigs: - headerLine += "{configName:^15}|".format(configName=testConfig.label) +resultFileName = os.path.join(os.path.dirname(os.path.abspath(__file__)), "Results/run-" + datetime.datetime.now().strftime("%Y.%m.%d.%H.%M.%S")) + +with open(resultFileName, 'w', newline='') as resultFile: + resultWriter = csv.writer(resultFile) + resultHeaderRow = [""] -print(headerLine) + headerLine = "{empty:<40}|".format(empty="") + + for testConfig in selectedTestConfigs: + headerLine += "{configName:^15}|".format(configName=testConfig.label) + resultHeaderRow.append(configName) -for testName in sorted(testNames): - resultLine = "{name:<40}|".format(name=testName) - for testConfig in selectedTestConfigs: - resultLine += "{avg:>11.2f} ms |".format(avg = resultsByTestName[testName][testConfig.label].averageTimeInMs) - print(resultLine) + print(headerLine) + resultWriter.writerow(resultHeaderRow) -print("** Done") + for testName in sorted(testNames): + resultLine = "{name:<40}|".format(name=testName) + resultRow=[testName] + + for testConfig in selectedTestConfigs: + resultLine += "{avg:>11.2f} ms |".format(avg = resultsByTestName[testName][testConfig.label].averageTimeInMs) + resultRow.append(resultsByTestName[testName][testConfig.label].averageTimeInMs) + + print(resultLine) + resultWriter.writerow(resultRow) + +print("** Done; results saved in " + resultFileName) diff -r 53575aa2614b -r ff939d07989f PerfsDb/Test.py --- a/PerfsDb/Test.py Mon Aug 20 14:54:32 2018 +0200 +++ b/PerfsDb/Test.py Mon Aug 20 15:50:47 2018 +0200 @@ -9,7 +9,7 @@ def __init__(self, name: str): self.name = name self._orthanc = None - self.repeatCount = 10 + self.repeatCount = 20 def setOrthancClient(self, orthanc: OrthancClient): self._orthanc = orthanc diff -r 53575aa2614b -r ff939d07989f PerfsDb/TestConfig.py --- a/PerfsDb/TestConfig.py Mon Aug 20 14:54:32 2018 +0200 +++ b/PerfsDb/TestConfig.py Mon Aug 20 15:50:47 2018 +0200 @@ -26,7 +26,7 @@ self.label = label self._port = None self._orthancProcess = None - self._repeatCount = 10 + self._repeatCount = 20 if dbServer is not None: self._dbType = dbServer.dbType