lib/gitlab/database/load_balancing/host.rb
# Returns the replication lag time of this secondary in seconds as a
# float.
#
# This method will return nil if no lag time could be calculated.
Returns the replication lag time of this secondary in seconds as a
float.

This method will return nil if no lag time could be calculated.
Returns the replication lag time of this secondary in seconds as a float . This method will return nil if no lag time could be calculated .
def replication_lag_time
          row = query_and_release('SELECT EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp()))::float as lag')
          row['lag'].to_f if row.any?
        end
def replication_lag_time row = query_and_release ( 'SELECT EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp()))::float as lag' ) row [ 'lag' ] . to_f if row . any? end
Returns the replication lag time of this secondary in seconds as a
float.
Returns the replication lag time of this secondary in seconds as a float .