# DbEnv.rep_stat

`

###

    import com.sleepycat.db.*;

    public DbRepStat rep_stat(int flags)
        throws DbException;

# Description

The DbEnv.rep_stat method returns the replication subsystem statistics.

The flags value must be set to 0 or the following value:

Db.DB_STAT_CLEAR
  Reset statistics after returning their values.

The DbEnv.rep_stat method creates a DbRepStat object encapsulating the replication subsystem statistics. The following data fields are available from the DbRepStat object:

public int st_stat;
  The current replication mode. Set to Db.DB_REP_MASTER if the environment is a replication master, Db.DB_REP_CLIENT if the environment is a replication client, Db.DB_REP_LOGSONLY if the environment is a log-files-only replica, or 0 if replication is not configured.
public DbLsn st_next_lsn;
  In replication environments configured as masters, the next LSN expected. In replication environments configured as clients, the next LSN to be used.
public DbLsn st_waiting_lsn;
  The LSN of the first missed log record being waited for, or 0 if no log records are currently missing.
public int st_dupmasters;
  The number of duplicate master conditions detected.
public int st_env_id;
  The current environment ID.
public int st_env_priority;
  The current environment priority.
public int st_gen;
  The current generation number.
public int st_log_duplicated;
  The number of duplicate log records received.
public int st_log_queued;
  The number of log records currently queued.
public int st_log_queued_max;
  The maximum number of log records ever queued at once.
public int st_log_queued_total;
  The total number of log records queued.
public int st_log_records;
  The number of log records received and appended to the log.
public int st_log_requested;
  The number of log records missed and requested.
public int st_master;
  The current master environment ID.
public int st_master_changes;
  The number of times the master has changed.
public int st_msgs_badgen;
  The number of messages received with a bad generation number.
public int st_msgs_processed;
  The number of messages received and processed.
public int st_msgs_recover;
  The number of messages ignored due to pending recovery.
public int st_msgs_send_failures;
  The number of failed message sends.
public int st_msgs_sent;
  The number of messages sent.
public int st_newsites;
  The number of new site messages received.
public int st_outdated;
  The number of outdated conditions detected.
public int st_txns_applied;
  The number of transactions applied.
public int st_elections;
  The number of elections held.
public int st_elections_won;
  The number of elections won.
public int st_election_status;
  The current election phase (0 if no election is in progress).
public int st_election_cur_winner;
  The election winner.
public int st_election_gen;
  The election generation number.
public DbLsn st_election_lsn;
  The maximum LSN of election winner.
public int st_election_nsites;
  The number sites expected to participate in elections.
public int st_nthrottles;
  Transmission limited. This indicates the number of times that data transmission was stopped to limit the amount of data sent in response to a single call to DbEnv.rep_process_message.
public int st_election_priority;
  The election priority.
public int st_election_tiebreaker;
  The election tiebreaker value.
public int st_election_votes;
  The votes received this election round.

The DbEnv.rep_stat method throws an exception that encapsulates a non-zero error value on failure.

# Errors

The DbEnv.rep_stat method may fail and throw an exception for errors specified for other Berkeley DB and C library or system methods. If a catastrophic error has occurred, the DbEnv.rep_stat method may fail and throw a DbRunRecoveryException, in which case all subsequent Berkeley DB calls will fail in the same way.

# Class

DbEnv

# See Also

Replication and Related Methods`

Copyright Sleepycat Software