-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbaserunner.py
More file actions
34 lines (24 loc) · 774 Bytes
/
baserunner.py
File metadata and controls
34 lines (24 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import signal
import math
import time
from gevent.event import Event
import suites
class BaseRunner(object):
''' base runner class '''
where = None # where runner to run
@property
def agents(self):
''' used for agents page '''
raise RuntimeError('unimplemented!')
def cancel(self):
''' cancel last execution '''
signal.alarm(1) # set alarm signal
def execute(self, operation, amount, ratio, loop, interval, kwargs):
raise RuntimeError('unimplemented!')
def _execute(self, operation, number):
''' real execution
'''
return getattr(suites, operation)(number)
def stop(self):
''' stop the whole runner '''
raise RuntimeError('unimplemented!')