# HG changeset patch # User Sebastien Jodogne # Date 1546960968 -3600 # Node ID f42c10dab8623e86f5882c114d992081cdc590ba # Parent dd05820b9f44edfdfab024337ebf9f75922bc4b6 drop cache diff -r dd05820b9f44 -r f42c10dab862 PerfsDb/Test.py --- a/PerfsDb/Test.py Tue Jan 08 15:38:34 2019 +0100 +++ b/PerfsDb/Test.py Tue Jan 08 16:22:48 2019 +0100 @@ -1,3 +1,4 @@ +import os import time import statistics from orthancRestApi import OrthancClient @@ -58,7 +59,13 @@ for i in range(0, self.repeatCount): self.beforeEach() - + + try: + with open('/proc/sys/vm/drop_caches', 'w') as f: + f.write('3') + except: + print('Please run this script as root to be able to flush the disk cache, and have reproducible runtimes') + startTime = time.time() self.test() endTime = time.time() @@ -77,4 +84,4 @@ avg = self.averageTimeInMs, min=self.minTimeInMs, max=self.maxTimeInMs - ) \ No newline at end of file + )