def get_stats_table_bloat()

in postgresql_metrics/metrics_gatherer.py [0:0]


def get_stats_table_bloat(_data_dir, db_connection):
    tables_with_oids = get_tables_with_oids_for_current_db(db_connection)
    metrics = []
    for table_oid, table_name in tables_with_oids:
        db_name, table_bloat_percentage = get_table_bloat(db_connection, table_oid)
        if db_name:
            metrics.append(metric_table_bloat(db_name, table_name, table_bloat_percentage))
    return metrics