(self)
| 24 | class Runner(BenchmarkThread): |
| 25 | |
| 26 | def run(self): |
| 27 | futures = queue.Queue(maxsize=121) |
| 28 | |
| 29 | self.start_profile() |
| 30 | |
| 31 | for i in range(self.num_queries): |
| 32 | if i > 0 and i % 120 == 0: |
| 33 | # clear the existing queue |
| 34 | while True: |
| 35 | try: |
| 36 | futures.get_nowait().result() |
| 37 | except queue.Empty: |
| 38 | break |
| 39 | |
| 40 | key = "{0}-{1}".format(self.thread_num, i) |
| 41 | future = self.run_query(key) |
| 42 | futures.put_nowait(future) |
| 43 | |
| 44 | while True: |
| 45 | try: |
| 46 | futures.get_nowait().result() |
| 47 | except queue.Empty: |
| 48 | break |
| 49 | |
| 50 | self.finish_profile() |
| 51 | |
| 52 | |
| 53 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected