|
8 | 8 | import subprocess
|
9 | 9 | import numpy as np
|
10 | 10 | from logging import getLogger
|
11 |
| -from typing import Union |
12 | 11 | from tqdm import tqdm
|
13 | 12 | from psycopg2.extras import DictCursor
|
14 | 13 | from sklearn import linear_model
|
|
20 | 19 | from pgopttune.utils.command import run_command
|
21 | 20 | from pgopttune.config.postgres_server_config import PostgresServerConfig
|
22 | 21 | from pgopttune.workload.my_workload import MyWorkLoad
|
23 |
| -from pgopttune.workload.oltpbench import Oltpbench |
24 |
| -from pgopttune.workload.pgbench import Pgbench |
25 | 22 |
|
26 | 23 | logger = getLogger(__name__)
|
27 | 24 |
|
28 | 25 |
|
29 | 26 | class Recovery(PostgresParameter):
|
30 | 27 | def __init__(self,
|
31 | 28 | postgres_server_config: PostgresServerConfig,
|
32 |
| - workload: Union[Oltpbench, Pgbench, MyWorkLoad], |
| 29 | + workload: MyWorkLoad, |
33 | 30 | required_recovery_time_second=300,
|
34 | 31 | measurement_second_scale=300,
|
35 | 32 | measurement_pattern=10):
|
@@ -225,14 +222,13 @@ def random_string(length):
|
225 | 222 |
|
226 | 223 | if __name__ == "__main__":
|
227 | 224 | from pgopttune.config.postgres_server_config import PostgresServerConfig
|
228 |
| - from pgopttune.config.oltpbench_config import OltpbenchConfig |
| 225 | + from pgopttune.config.my_workload_config import MyWorkloadConfig |
229 | 226 | from logging import basicConfig, DEBUG
|
230 | 227 |
|
231 | 228 | basicConfig(level=DEBUG)
|
232 | 229 | conf_path = './conf/postgres_opttune.conf'
|
233 | 230 | postgres_server_config_test = PostgresServerConfig(conf_path) # PostgreSQL Server config
|
234 |
| - oltpbench_config_test = OltpbenchConfig(conf_path) |
235 |
| - workload_test = Oltpbench(postgres_server_config=postgres_server_config_test, |
236 |
| - oltpbench_config=oltpbench_config_test) |
| 231 | + my_wolkload_config_test = MyWorkloadConfig(conf_path) |
| 232 | + workload_test = MyWorkLoad(postgres_server_config=postgres_server_config_test,my_workload_config=my_wolkload_config_test) |
237 | 233 | recovery = Recovery(postgres_server_config_test, required_recovery_time_second=300, workload=workload_test)
|
238 | 234 | logger.debug(recovery.estimate_check_point_parameters())
|
0 commit comments