driver/database.py
def collect_table_level_data_from_database(driver_conf: Dict[str, Any]) -> TableLevelObservation:
    """
    Get the table level metrics data from the target database.

    Args:
        config: driver configuration.
    Returns:
        Collected data from the target database.
    Raises:
        DriverConfigException: invalid database configuration.
        DbCollectorException: database type is not supported.
        MysqlCollectorException: unable to connect to MySQL database or get version.
        PostgresCollectorException: unable to connect to Postgres database or get version.
    """

    with get_collector(driver_conf) as collector:
        observation_time = int(time.time())
        data = collector.collect_table_level_metrics(driver_conf["num_table_to_collect_stats"])
        version = collector.get_version()
        summary: Dict[str, Any] = {
            "version": version,
            "observation_time": observation_time,
        }

    observation: TableLevelObservation = {
        "data": data,
        "summary": summary,
        "db_key": driver_conf["db_key"],
        "organization_id": driver_conf["organization_id"],
    }
    return observation

    Get the table level metrics data from the target database.

    Args:
        config: driver configuration.
    Returns:
        Collected data from the target database.
    Raises:
        DriverConfigException: invalid database configuration.
        DbCollectorException: database type is not supported.
        MysqlCollectorException: unable to connect to MySQL database or get version.
        PostgresCollectorException: unable to connect to Postgres database or get version.
    
Get the table level metrics data from the target database.
Get the table level metrics data from the target database .
def collect_table_level_data_from_database(driver_conf: Dict[str, Any]) -> TableLevelObservation:
    with get_collector(driver_conf) as collector:
        observation_time = int(time.time())
        data = collector.collect_table_level_metrics(driver_conf["num_table_to_collect_stats"])
        version = collector.get_version()
        summary: Dict[str, Any] = {
            "version": version,
            "observation_time": observation_time,
        }
    observation: TableLevelObservation = {
        "data": data,
        "summary": summary,
        "db_key": driver_conf["db_key"],
        "organization_id": driver_conf["organization_id"],
    }
    return observation
def collect_table_level_data_from_database ( driver_conf : Dict [ str , Any ] ) -> TableLevelObservation : with get_collector ( driver_conf ) as collector : observation_time = int ( time . time ( ) ) data = collector . collect_table_level_metrics ( driver_conf [ "num_table_to_collect_stats" ] ) version = collector . get_version ( ) summary : Dict [ str , Any ] = { "version" : version , "observation_time" : observation_time , } observation : TableLevelObservation = { "data" : data , "summary" : summary , "db_key" : driver_conf [ "db_key" ] , "organization_id" : driver_conf [ "organization_id" ] , } return observation
Get the table level metrics data from the target database.
Get the table level metrics data from the target database .
"""
    Get the table level metrics data from the target database.

    Args:
        config: driver configuration.
    Returns:
        Collected data from the target database.
    Raises:
        DriverConfigException: invalid database configuration.
        DbCollectorException: database type is not supported.
        MysqlCollectorException: unable to connect to MySQL database or get version.
        PostgresCollectorException: unable to connect to Postgres database or get version.
    """
Collected data from the target database.
Collected data from the target database .
invalid database configuration.
invalid database configuration .
DriverConfigException
database type is not supported.
database type is not supported .
DbCollectorException
unable to connect to MySQL database or get version.
unable to connect to MySQL database or get version .
MysqlCollectorException
unable to connect to Postgres database or get version.
unable to connect to Postgres database or get version .
PostgresCollectorException
driver_conf
Dict[str, Any]
config
None