-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
38 lines (32 loc) · 1.11 KB
/
main.py
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
35
36
37
38
import time
from others.KHPA import KHPA
from others.MicroScaler import MicroScaler
from others.Showar import Showar
from others.NoneController import NoneController
from others.RandomController import RandomController
from PBScaler import PBScaler
from monitor import MetricCollect
from config.Config import Config
import warnings
warnings.filterwarnings("ignore")
def initController(name: str, config: Config):
if name == 'MicroScaler':
return MicroScaler(config)
elif name == 'SHOWAR':
return Showar(config)
elif name == 'KHPA':
return KHPA(config)
elif name == 'random':
return RandomController(config)
elif name == 'PBScaler':
simulation_model_path = '/home/ubuntu/xsy/experiment/autoscaling/simulation/train_ticket/RandomForestClassify.model'
return PBScaler(config, simulation_model_path)
else:
raise NotImplementedError()
if __name__ == '__main__':
config = Config()
controller = initController('PBScaler', config)
controller.start()
# collect metrics
data_path = './output'
MetricCollect.collect(config, data_path)