MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / run

Method run

benchmarks/future_batches.py:26–50  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

24class 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
53if __name__ == "__main__":

Callers

nothing calls this directly

Calls 4

start_profileMethod · 0.80
resultMethod · 0.80
run_queryMethod · 0.80
finish_profileMethod · 0.80

Tested by

no test coverage detected