File tree Expand file tree Collapse file tree 2 files changed +17
-7
lines changed
Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 1212controller_db = ConnectionHandler ({'default' : settings .controller_db })['default' ]
1313metrics_db = ConnectionHandler ({'default' : settings .metrics_db })['default' ]
1414
15+ # Create storage table if it doesn't exist
16+ storage_config = {
17+ 'db' : metrics_db ,
18+ 'table' : 'metrics_data' ,
19+ 'key_field' : 'key' ,
20+ 'value_field' : 'value' ,
21+ 'timestamp_field' : 'updated_at' ,
22+ }
23+
24+ library .storage .postgres .create_storage_table (** storage_config )
25+
1526# Setup PostgreSQL storage using metrics_db
16- postgres_storage = library .storage .StoragePostgres (
17- db = metrics_db ,
18- table = 'metrics_data' ,
19- key_field = 'key' ,
20- value_field = 'value' ,
21- timestamp_field = 'updated_at' ,
22- )
27+ postgres_storage = library .storage .StoragePostgres (** storage_config )
2328
2429# Time range for collectors
2530since = library .instants .last_day ()
Original file line number Diff line number Diff line change 22
33from dataclasses import dataclass , field
44
5+ from metrics_utility import prepare
6+
7+
8+ prepare ()
9+
510
611@dataclass
712class Settings :
You can’t perform that action at this time.
0 commit comments