1<!--$Id: repmgr_stat.so,v 10.2 2007/09/21 20:06:04 bostic Exp $-->
2<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
3<!--See the file LICENSE for redistribution information.-->
4<html>
5<head>
6<title>Berkeley DB: DB_ENV-&gt;repmgr_stat</title>
7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
9</head>
10<body bgcolor=white>
11<table width="100%"><tr valign=top>
12<td>
13<b>DB_ENV-&gt;repmgr_stat</b>
14</td>
15<td align=right>
16<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a>
17<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td>
18</tr></table>
19<hr size=1 noshade>
20<tt>
21<b><pre>
22#include &lt;db.h&gt;
23<p>
24int
25DB_ENV-&gt;repmgr_stat(DB_ENV *env, DB_REPMGR_STAT **statp, u_int32_t flags);
26<p>
27int
28DB_ENV-&gt;repmgr_stat_print(DB_ENV *env, u_int32_t flags);
29</pre></b>
30<hr size=1 noshade>
31<b>Description: DB_ENV-&gt;repmgr_stat</b>
32<p>The DB_ENV-&gt;repmgr_stat method returns the replication manager statistics.</p>
33<p>The DB_ENV-&gt;repmgr_stat method creates a statistical structure of type
34DB_REPMGR_STAT and copies a pointer to it into a user-specified memory
35location.</p>
36<p>Statistical structures are stored in allocated memory.  If application-specific allocation
37routines have been declared (see <a href="../api_c/env_set_alloc.html">DB_ENV-&gt;set_alloc</a> for more
38information), they are used to allocate the memory; otherwise, the
39standard C library <b>malloc</b>(3) is used.  The caller is
40responsible for deallocating the memory.  To deallocate the memory, free
41the memory reference; references inside the returned memory need not be
42individually freed.</p>
43<p>The following DB_REPMGR_STAT fields will be filled in:</p>
44<br>
45<b>u_int32_t st_perm_failed;</b><ul compact><li>The number of times a message critical for maintaining database
46integrity (for example, a transaction commit), originating at this site,
47did not receive sufficient acknowledgement from clients, according to
48the configured acknowledgement policy and acknowledgement timeout.</ul>
49<b>u_int32_t st_msgs_queued;</b><ul compact><li>The number of outgoing messages which could not be transmitted
50immediately, due to a full network buffer, and had to be queued for
51later delivery.</ul>
52<b>u_int32_t st_msgs_dropped;</b><ul compact><li>The number of outgoing messages that were completely dropped, because
53the outgoing message queue was full.  (Berkeley DB replication is tolerant of
54dropped messages, and will automatically request retransmission of any
55missing messages as needed.)</ul>
56<b>u_int32_t st_connection_drop;</b><ul compact><li>The number of times an existing TCP/IP connection failed.</ul>
57<b>u_int32_t st_connect_fail;</b><ul compact><li>The number of times an attempt to open a new TCP/IP connection failed.</ul>
58<br>
59<p>The DB_ENV-&gt;repmgr_stat method may not be called before the <a href="../api_c/env_open.html">DB_ENV-&gt;open</a> method is called.</p>
60<p>The DB_ENV-&gt;repmgr_stat method
61returns a non-zero error value on failure
62and 0 on success.
63</p>
64<b>Parameters</b> <br>
65 <b>flags</b><ul compact><li>The <b>flags</b> parameter must be set to 0 or
66the following value:
67<br>
68<b><a name="DB_STAT_CLEAR">DB_STAT_CLEAR</a></b><ul compact><li>Reset statistics after returning their values.</ul>
69<br></ul>
70 <b>statp</b><ul compact><li>The <b>statp</b> parameter references memory into which
71a pointer to the allocated statistics structure is copied.</ul> 
72<br>
73<br><b>Errors</b>
74<p>The DB_ENV-&gt;repmgr_stat method
75may fail and return one of the following non-zero errors:</p>
76<br>
77<b>EINVAL</b><ul compact><li>An
78invalid flag value or parameter was specified.</ul>
79<br>
80<hr size=1 noshade>
81<b>Description: DB_ENV-&gt;repmgr_stat_print</b>
82<p>The DB_ENV-&gt;repmgr_stat_print method displays the
83replication manager statistical information, as described for the DB_ENV-&gt;repmgr_stat method.
84The information is printed to a specified output channel (see the
85<a href="../api_c/env_set_msgfile.html">DB_ENV-&gt;set_msgfile</a> method for more information), or passed to an
86application callback function (see the <a href="../api_c/env_set_msgcall.html">DB_ENV-&gt;set_msgcall</a> method for
87more information).</p>
88<p>The DB_ENV-&gt;repmgr_stat_print method may not be called before the <a href="../api_c/env_open.html">DB_ENV-&gt;open</a> method is called.</p>
89<p>The DB_ENV-&gt;repmgr_stat_print method
90returns a non-zero error value on failure
91and 0 on success.
92</p>
93<b>Parameters</b> <br>
94 <b>flags</b><ul compact><li>The <b>flags</b> parameter must be set to 0 or by bitwise inclusively <b>OR</b>'ing together one
95or more of the following values:
96<br>
97<b><a name="DB_STAT_ALL">DB_STAT_ALL</a></b><ul compact><li>Display all available information.</ul>
98<b><a name="DB_STAT_CLEAR">DB_STAT_CLEAR</a></b><ul compact><li>Reset statistics after displaying their values.</ul>
99<br></ul>
100<br>
101<hr size=1 noshade>
102<br><b>Class</b>
103<a href="../api_c/env_class.html">DB_ENV</a>
104<br><b>See Also</b>
105<a href="../api_c/rep_list.html">Replication and Related Methods</a>
106</tt>
107<table width="100%"><tr><td><br></td><td align=right>
108<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a>
109</td></tr></table>
110<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
111</body>
112</html>
113