1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>DB_ENV->repmgr_stat()</title> 7 <link rel="stylesheet" href="apiReference.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Berkeley DB C API Reference" /> 10 <link rel="up" href="rep.html" title="Chapter 10. Replication Methods" /> 11 <link rel="prev" href="repmgrstart.html" title="DB_ENV->repmgr_start()" /> 12 <link rel="next" href="repmgrstat_print.html" title="DB_ENV->repmgr_stat_print()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DB_ENV->repmgr_stat()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="repmgrstart.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 10. 23 Replication Methods 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="repmgrstat_print.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="repmgrstat"></a>DB_ENV->repmgr_stat()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db.h> 39 40int 41DB_ENV->repmgr_stat(DB_ENV *env, DB_REPMGR_STAT **statp, 42 u_int32_t flags); </pre> 43 <p> 44 The <code class="methodname">DB_ENV->repmgr_stat()</code> method returns the Replication Manager 45 statistics. 46 </p> 47 <p> 48 The <code class="methodname">DB_ENV->repmgr_stat()</code> method creates a statistical structure of 49 type <code class="literal">DB_REPMGR_STAT</code> and copies a pointer to it into a user-specified 50 memory location. 51 </p> 52 <p> 53 Statistical structures are stored in allocated memory. If application-specific allocation 54 routines have been declared (see <a class="xref" href="envset_alloc.html" title="DB_ENV->set_alloc()">DB_ENV->set_alloc()</a> 55 for more information), they are used to allocate the memory; otherwise, the standard 56 C library <span class="bold"><strong>malloc</strong></span>(3) is used. The caller is responsible 57 for deallocating the memory. To deallocate the memory, free the memory reference; 58 references inside the returned memory need not be individually freed. 59 </p> 60 <p> 61 The following <code class="literal">DB_REPMGR_STAT</code> fields will be filled in: 62 </p> 63 <div class="itemizedlist"> 64 <ul type="disc"> 65 <li> 66 <p> 67 <span class="bold"><strong>uintmax_t st_connect_fail;</strong></span> 68 </p> 69 <p> 70 The number of times an attempt to open a new TCP/IP connection failed. 71 </p> 72 </li> 73 <li> 74 <p> 75 <span class="bold"><strong>uintmax_t st_connection_drop;</strong></span> 76 </p> 77 <p> 78 The number of times an existing TCP/IP connection 79 failed. 80 </p> 81 </li> 82 <li> 83 <p> 84 <span class="bold"><strong>uintmax_t st_msgs_dropped;</strong></span> 85 </p> 86 <p> 87 The number of outgoing messages that were completely dropped, because 88 the outgoing message queue was full. (Berkeley DB replication is 89 tolerant of dropped messages, and will automatically request 90 retransmission of any missing messages as needed.) 91 </p> 92 </li> 93 <li> 94 <p> 95 <span class="bold"><strong>uintmax_t st_msgs_queued;</strong></span> 96 </p> 97 <p> 98 The number of outgoing messages which could not be transmitted 99 immediately, due to a full network buffer, and had to be queued for 100 later delivery. 101 </p> 102 </li> 103 <li> 104 <p> 105 <span class="bold"><strong>uintmax_t st_perm_failed;</strong></span> 106 </p> 107 <p> 108 The number of times a message critical for maintaining database 109 integrity (for example, a transaction commit), originating at this 110 site, did not receive sufficient acknowledgement from clients, 111 according to the configured acknowledgement policy and acknowledgement 112 timeout. 113 </p> 114 </li> 115 </ul> 116 </div> 117 <p> 118 The <code class="methodname">DB_ENV->repmgr_stat()</code> method may not be called before the 119 <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a> method is called. 120 </p> 121 <p> 122 The <code class="methodname">DB_ENV->repmgr_stat()</code> <span> 123 <span> 124 method returns a non-zero error value on failure and 0 on success. 125 </span> 126 127 </span> 128 </p> 129 <div class="sect2" lang="en" xml:lang="en"> 130 <div class="titlepage"> 131 <div> 132 <div> 133 <h3 class="title"><a id="id1704097"></a>Parameters</h3> 134 </div> 135 </div> 136 </div> 137 <div class="sect3" lang="en" xml:lang="en"> 138 <div class="titlepage"> 139 <div> 140 <div> 141 <h4 class="title"><a id="id1704005"></a>flags</h4> 142 </div> 143 </div> 144 </div> 145 <p> 146 The <span class="bold"><strong>flags</strong></span> parameter must be set to 0 147 or the following value: 148 </p> 149 <div class="itemizedlist"> 150 <ul type="disc"> 151 <li> 152 <p> 153 <code class="literal">DB_STAT_CLEAR</code> 154 </p> 155 <p> 156 Reset statistics after returning their values. 157 </p> 158 </li> 159 </ul> 160 </div> 161 </div> 162 <div class="sect3" lang="en" xml:lang="en"> 163 <div class="titlepage"> 164 <div> 165 <div> 166 <h4 class="title"><a id="id1704158"></a>statp</h4> 167 </div> 168 </div> 169 </div> 170 <p> 171 The <span class="bold"><strong>statp</strong></span> parameter references memory 172 into which a pointer to the allocated statistics structure is copied. 173 </p> 174 </div> 175 </div> 176 <div class="sect2" lang="en" xml:lang="en"> 177 <div class="titlepage"> 178 <div> 179 <div> 180 <h3 class="title"><a id="id1704296"></a>Errors</h3> 181 </div> 182 </div> 183 </div> 184 <p> 185 The <code class="methodname">DB_ENV->repmgr_stat()</code> <span> 186 <span> 187 method may fail and return one of the following non-zero errors: 188 </span> 189 190 </span> 191 </p> 192 <div class="sect3" lang="en" xml:lang="en"> 193 <div class="titlepage"> 194 <div> 195 <div> 196 <h4 class="title"><a id="id1704292"></a>EINVAL</h4> 197 </div> 198 </div> 199 </div> 200 <p> 201 If the method was called before <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a> 202 was called; or if an invalid flag value or parameter was specified. 203 </p> 204 </div> 205 </div> 206 <div class="sect2" lang="en" xml:lang="en"> 207 <div class="titlepage"> 208 <div> 209 <div> 210 <h3 class="title"><a id="id1703921"></a>Class</h3> 211 </div> 212 </div> 213 </div> 214 <p> 215 <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a> 216 </p> 217 </div> 218 <div class="sect2" lang="en" xml:lang="en"> 219 <div class="titlepage"> 220 <div> 221 <div> 222 <h3 class="title"><a id="id1703518"></a>See Also</h3> 223 </div> 224 </div> 225 </div> 226 <p> 227 <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a> 228 </p> 229 </div> 230 </div> 231 <div class="navfooter"> 232 <hr /> 233 <table width="100%" summary="Navigation footer"> 234 <tr> 235 <td width="40%" align="left"><a accesskey="p" href="repmgrstart.html">Prev</a> </td> 236 <td width="20%" align="center"> 237 <a accesskey="u" href="rep.html">Up</a> 238 </td> 239 <td width="40%" align="right"> <a accesskey="n" href="repmgrstat_print.html">Next</a></td> 240 </tr> 241 <tr> 242 <td width="40%" align="left" valign="top">DB_ENV->repmgr_start() </td> 243 <td width="20%" align="center"> 244 <a accesskey="h" href="index.html">Home</a> 245 </td> 246 <td width="40%" align="right" valign="top"> DB_ENV->repmgr_stat_print()</td> 247 </tr> 248 </table> 249 </div> 250 </body> 251</html> 252