File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+
3+ import ndcctools .taskvine as vine
4+ import time
5+
6+ if __name__ == "__main__" :
7+
8+ q = vine .Manager ()
9+ print ("listening on port" , q .port )
10+ factory = vine .Factory ("local" ,manager_host_port = "localhost:{}" .format (q .port ))
11+ factory .max_workers = 1
12+ factory .min_workers = 1
13+ factory .disk = 100
14+
15+ num_tasks = 1000
16+
17+ with factory :
18+ for i in range (num_tasks ):
19+ t = vine .Task (command = ":" )
20+ task_id = q .submit (t )
21+
22+ print ("waiting for tasks to complete..." )
23+
24+ start_timer = True
25+ while not q .empty ():
26+
27+ t = q .wait (5 )
28+ if start_timer :
29+ start = time .time ()
30+ start_timer = False
31+
32+ end = time .time ()
33+ e = end - start
34+ print (f"It took { e } seconds\n " )
35+ print (f"Throughput was { num_tasks / e } tasks per second" )
36+ print ("all tasks complete!" )
37+
38+ # vim: set sts=4 sw=4 ts=4 expandtab ft=python:
39+
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # Install conda development environment
4+ . ./install-conda-devel.sh
5+
6+ # Install conda development environment
7+ . ./install-github.sh
8+
9+ # Run the serverless test case.
10+ python3 test-vine-task-throughput.py
You can’t perform that action at this time.
0 commit comments