code: def replica_lag(self, **kwargs):
          
          if not self._use_replica():
              return 0
          try:
              kwargs['stack'] = self.stack_mark(inspect.stack())
              sql = "select EXTRACT(EPOCH FROM NOW() - pg_last_xact_replay_timestamp()) AS replication_lag"
              return self.collection_instance(
                  self.db_adapter().raw_query(
                      sql=sql, **kwargs
                      )
                  ).squeeze()
          except:
              return 0
docs: Returns the current replication lag in seconds between the master and replica databases.
  
          :returns: float