comparison PerfsDb/Test.py @ 200:f42c10dab862

drop cache
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 08 Jan 2019 16:22:48 +0100
parents ff939d07989f
children
comparison
equal deleted inserted replaced
199:dd05820b9f44 200:f42c10dab862
1 import os
1 import time 2 import time
2 import statistics 3 import statistics
3 from orthancRestApi import OrthancClient 4 from orthancRestApi import OrthancClient
4 5
5 from TestResult import TestResult 6 from TestResult import TestResult
56 57
57 self.beforeAll() 58 self.beforeAll()
58 59
59 for i in range(0, self.repeatCount): 60 for i in range(0, self.repeatCount):
60 self.beforeEach() 61 self.beforeEach()
61 62
63 try:
64 with open('/proc/sys/vm/drop_caches', 'w') as f:
65 f.write('3')
66 except:
67 print('Please run this script as root to be able to flush the disk cache, and have reproducible runtimes')
68
62 startTime = time.time() 69 startTime = time.time()
63 self.test() 70 self.test()
64 endTime = time.time() 71 endTime = time.time()
65 72
66 self.afterEach() 73 self.afterEach()