in postgresql_metrics/metrics_logic.py [0:0]
def get_all_metrics_scheduled(db_connections, conf):
"""Get all the metrics in scheduled manner, not calling all the functions every time.
First gets the global stats with first available database connection,
and then gets the rest per database.
"""
db_functions, global_db_functions = get_all_stats_functions_from_conf(conf)
data_dir = figure_out_postgres_data_dir(db_connections[0], conf)
all_metrics = _call_all_db_functions(global_db_functions, (data_dir, db_connections[0]), schedule=True)
for db_connection in db_connections:
db_name = get_db_name_from_connection(db_connection)
all_metrics.extend(_call_all_db_functions(db_functions, (data_dir, db_connection),
schedule=True, db_name=db_name))
return all_metrics