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: DbEnv::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>DbEnv::repmgr_stat</b> 14</td> 15<td align=right> 16<a href="/api_cxx/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 <db_cxx.h> 23<p> 24int 25DbEnv::repmgr_stat(DB_REPMGR_STAT **statp, u_int32_t flags); 26<p> 27int 28DbEnv::repmgr_stat_print(u_int32_t flags); 29</pre></b> 30<hr size=1 noshade> 31<b>Description: DbEnv::repmgr_stat</b> 32<p>The DbEnv::repmgr_stat method returns the replication manager statistics.</p> 33<p>The DbEnv::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_cxx/env_set_alloc.html">DbEnv::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 DbEnv::repmgr_stat method may not be called before the <a href="/api_cxx/env_open.html">DbEnv::open</a> method is called.</p> 60<p>The DbEnv::repmgr_stat method 61either returns a non-zero error value 62or throws an exception that encapsulates a non-zero error value on 63failure, and returns 0 on success. 64</p> 65<b>Parameters</b> <br> 66 <b>flags</b><ul compact><li>The <b>flags</b> parameter must be set to 0 or 67the following value: 68<br> 69<b><a name="DB_STAT_CLEAR">DB_STAT_CLEAR</a></b><ul compact><li>Reset statistics after returning their values.</ul> 70<br></ul> 71 <b>statp</b><ul compact><li>The <b>statp</b> parameter references memory into which 72a pointer to the allocated statistics structure is copied.</ul> 73<br> 74<br><b>Errors</b> 75<p>The DbEnv::repmgr_stat method 76may fail and throw 77<a href="/api_cxx/except_class.html">DbException</a>, 78encapsulating one of the following non-zero errors, or return one of 79the following non-zero errors:</p> 80<br> 81<b>EINVAL</b><ul compact><li>An 82invalid flag value or parameter was specified.</ul> 83<br> 84<hr size=1 noshade> 85<b>Description: DbEnv::repmgr_stat_print</b> 86<p>The DbEnv::repmgr_stat_print method displays the 87replication manager statistical information, as described for the DbEnv::repmgr_stat method. 88The information is printed to a specified output channel (see the 89<a href="/api_cxx/env_set_msgfile.html">DbEnv::set_msgfile</a> method for more information), or passed to an 90application callback function (see the <a href="/api_cxx/env_set_msgcall.html">DbEnv::set_msgcall</a> method for 91more information).</p> 92<p>The DbEnv::repmgr_stat_print method may not be called before the <a href="/api_cxx/env_open.html">DbEnv::open</a> method is called.</p> 93<p>The DbEnv::repmgr_stat_print method 94either returns a non-zero error value 95or throws an exception that encapsulates a non-zero error value on 96failure, and returns 0 on success. 97</p> 98<b>Parameters</b> <br> 99 <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 100or more of the following values: 101<br> 102<b><a name="DB_STAT_ALL">DB_STAT_ALL</a></b><ul compact><li>Display all available information.</ul> 103<b><a name="DB_STAT_CLEAR">DB_STAT_CLEAR</a></b><ul compact><li>Reset statistics after displaying their values.</ul> 104<br></ul> 105<br> 106<hr size=1 noshade> 107<br><b>Class</b> 108<a href="/api_cxx/env_class.html">DbEnv</a> 109<br><b>See Also</b> 110<a href="/api_cxx/rep_list.html">Replication and Related Methods</a> 111</tt> 112<table width="100%"><tr><td><br></td><td align=right> 113<a href="/api_cxx/api_core.html"><img src="/images/api.gif" alt="API"></a><a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a> 114</td></tr></table> 115<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 116</body> 117</html> 118