(self, db, above_560, nonblocking)
Retrieve the replicas statuses using:
        1. The `performance_schema.threads` table. Non-blocking, requires version > 5.6.0
        2. The `information_schema.processlist` table. Blocking
Retrieve the replicas statuses using:
        1. The `performance_schema.threads` table. Non-blocking, requires version > 5.6.0
        2. The `information_schema.processlist` table. Blocking
Retrieve the replicas statuses using : 1 . The performance_schema . threads table . Non - blocking requires version > 5 . 6 . 0 2 . The information_schema . processlist table . Blocking
def _get_replica_status(self, db, above_560, nonblocking):
        """
        Retrieve the replicas statuses using:
        1. The `performance_schema.threads` table. Non-blocking, requires version > 5.6.0
        2. The `information_schema.processlist` table. Blocking
        """
        try:
            with closing(db.cursor()) as cursor:
                if above_560 and nonblocking:
                    # Query `performance_schema.threads` instead of `
                    # information_schema.processlist` to avoid mutex impact on performance.
                    cursor.execute(SQL_WORKER_THREADS)
                else:
                    cursor.execute(SQL_PROCESS_LIST)
                replica_results = cursor.fetchall()
                replicas = 0
                for _ in replica_results:
                    replicas += 1

                return {'Replicas_connected': replicas}

        except (pymysql.err.InternalError, pymysql.err.OperationalError) as e:
            self.warning("Privileges error accessing the process tables (must grant PROCESS): %s", e)
            return {}
def _get_replica_status ( self , db , above_560 , nonblocking ) : try : with closing ( db . cursor ( ) ) as cursor : if above_560 and nonblocking : # Query `performance_schema.threads` instead of ` # information_schema.processlist` to avoid mutex impact on performance. cursor . execute ( SQL_WORKER_THREADS ) else : cursor . execute ( SQL_PROCESS_LIST ) replica_results = cursor . fetchall ( ) replicas = 0 for _ in replica_results : replicas += 1 return { 'Replicas_connected' : replicas } except ( pymysql . err . InternalError , pymysql . err . OperationalError ) as e : self . warning ( "Privileges error accessing the process tables (must grant PROCESS): %s" , e ) return { }