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