-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdb_test.py
47 lines (37 loc) · 1.38 KB
/
db_test.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
39
40
41
42
43
44
45
46
47
from database_manager.exp_db_manager import ExpDbManager
from data_loader.data_loader import DataLoader
from data_loader.request.config_request import ConfigRequest
from data_loader.request.function_request import FunctionRequest
import datetime
#db_manager = ExpDbManager("database_design/experiment_db")
#db_manager.create_connection()
#db_manager.create_tables()
#db_manager.insert_node("node_1", 2, 1)
#db_manager.insert_function("funca", "Very simple function")
#db_manager.insert_function("qrcode", "Qrcode generation function")
#db_manager.insert_exp_instant(datetime.datetime.now(), 1)
#db_manager.insert_metric("ram_usage", "node", "%", 34, "RAM usage for a node", 1, node_id = 1)
#db_manager.insert_metric("afet", "func", "sec", 0.000000005, "Average Function Execution time", 1, function_id = 1)
#db_manager.insert_deploy(1, 1, 150, 5, 50, 100, "Underload")
#db_manager.insert_deploy(1, 2, 20, 2, 10, 10, "Underload")
#db_manager.select_example()
#db_manager.get_metrics(
# ConfigRequest(
# "node_1",
# [
# FunctionRequest("funca", 5, 50),
# FunctionRequest("qrcode", 2, 10)
# ]
# )
#)
dl = DataLoader()
#dl.select_example()
request = ConfigRequest("node_1",
[
FunctionRequest("qrcode", 1, 0),
FunctionRequest("ocr", 1, 0)
]
)
df_node, df_func = dl.get_metric_for_configuration(request)
#dl.select_example()
print("END")