driver/database.py
def collect_db_level_data_from_database(driver_conf: Dict[str, Any]) -> DBLevelObservation:
    """
    Get the db level knobs, metrics, summary 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())
        knobs = collector.collect_knobs()
        metrics = collector.collect_metrics()
        row_num_stats = collector.collect_table_row_number_stats()
        version = collector.get_version()
        summary: Dict[str, Any] = {
            "version": version,
            "observation_time": observation_time,
        }

    observation: DBLevelObservation = {
        "knobs_data": knobs,
        "metrics_data": metrics,
        "summary": summary,
        "row_num_stats": row_num_stats,
        "db_key": driver_conf["db_key"],
        "organization_id": driver_conf["organization_id"],
    }
    return observation

    Get the db level knobs, metrics, summary 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 db level knobs, metrics, summary data from the target database.
Get the db level knobs metrics summary data from the target database .
def collect_db_level_data_from_database(driver_conf: Dict[str, Any]) -> DBLevelObservation:
    with get_collector(driver_conf) as collector:
        observation_time = int(time.time())
        knobs = collector.collect_knobs()
        metrics = collector.collect_metrics()
        row_num_stats = collector.collect_table_row_number_stats()
        version = collector.get_version()
        summary: Dict[str, Any] = {
            "version": version,
            "observation_time": observation_time,
        }
    observation: DBLevelObservation = {
        "knobs_data": knobs,
        "metrics_data": metrics,
        "summary": summary,
        "row_num_stats": row_num_stats,
        "db_key": driver_conf["db_key"],
        "organization_id": driver_conf["organization_id"],
    }
    return observation
def collect_db_level_data_from_database ( driver_conf : Dict [ str , Any ] ) -> DBLevelObservation : with get_collector ( driver_conf ) as collector : observation_time = int ( time . time ( ) ) knobs = collector . collect_knobs ( ) metrics = collector . collect_metrics ( ) row_num_stats = collector . collect_table_row_number_stats ( ) version = collector . get_version ( ) summary : Dict [ str , Any ] = { "version" : version , "observation_time" : observation_time , } observation : DBLevelObservation = { "knobs_data" : knobs , "metrics_data" : metrics , "summary" : summary , "row_num_stats" : row_num_stats , "db_key" : driver_conf [ "db_key" ] , "organization_id" : driver_conf [ "organization_id" ] , } return observation
Get the db level knobs, metrics, summary data from the target database.
Get the db level knobs metrics summary data from the target database .
"""
    Get the db level knobs, metrics, summary 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