File: ex_stat_8c-example.html

package info (click to toggle)
wiredtiger 3.2.1-1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 25,456 kB
  • sloc: ansic: 102,922; python: 52,573; sh: 6,915; java: 6,130; cpp: 2,311; makefile: 1,018; xml: 176
file content (81 lines) | stat: -rw-r--r-- 23,575 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>WiredTiger: ex_stat.c</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="wiredtiger.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://wiredtiger.com/"><img alt="Logo" src="LogoFinal-header.png" alt="WiredTiger" /></a></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">
   &#160;<span id="projectnumber">Version 3.2.1</span>
   </div>
   <div id="projectbrief"><!-- 3.2.1 --></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<div class="banner">
  <a href="https://github.com/wiredtiger/wiredtiger">Fork me on GitHub</a>
  <a class="last" href="http://groups.google.com/group/wiredtiger-users">Join my user group</a>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('ex_stat_8c-example.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">ex_stat.c</div>  </div>
</div><!--header-->
<div class="contents">
<p>Shows how to access database and table statistics.</p>
<div class="fragment"><div class="line"><span class="comment">/*-</span></div><div class="line"><span class="comment"> * Public Domain 2014-2019 MongoDB, Inc.</span></div><div class="line"><span class="comment"> * Public Domain 2008-2014 WiredTiger, Inc.</span></div><div class="line"><span class="comment"> *</span></div><div class="line"><span class="comment"> * This is free and unencumbered software released into the public domain.</span></div><div class="line"><span class="comment"> *</span></div><div class="line"><span class="comment"> * Anyone is free to copy, modify, publish, use, compile, sell, or</span></div><div class="line"><span class="comment"> * distribute this software, either in source code form or as a compiled</span></div><div class="line"><span class="comment"> * binary, for any purpose, commercial or non-commercial, and by any</span></div><div class="line"><span class="comment"> * means.</span></div><div class="line"><span class="comment"> *</span></div><div class="line"><span class="comment"> * In jurisdictions that recognize copyright laws, the author or authors</span></div><div class="line"><span class="comment"> * of this software dedicate any and all copyright interest in the</span></div><div class="line"><span class="comment"> * software to the public domain. We make this dedication for the benefit</span></div><div class="line"><span class="comment"> * of the public at large and to the detriment of our heirs and</span></div><div class="line"><span class="comment"> * successors. We intend this dedication to be an overt act of</span></div><div class="line"><span class="comment"> * relinquishment in perpetuity of all present and future rights to this</span></div><div class="line"><span class="comment"> * software under copyright law.</span></div><div class="line"><span class="comment"> *</span></div><div class="line"><span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,</span></div><div class="line"><span class="comment"> * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF</span></div><div class="line"><span class="comment"> * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.</span></div><div class="line"><span class="comment"> * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR</span></div><div class="line"><span class="comment"> * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,</span></div><div class="line"><span class="comment"> * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR</span></div><div class="line"><span class="comment"> * OTHER DEALINGS IN THE SOFTWARE.</span></div><div class="line"><span class="comment"> *</span></div><div class="line"><span class="comment"> * ex_stat.c</span></div><div class="line"><span class="comment"> *      This is an example demonstrating how to query database statistics.</span></div><div class="line"><span class="comment"> */</span></div><div class="line"><span class="preprocessor">#include &lt;test_util.h&gt;</span></div><div class="line"></div><div class="line"><span class="keywordtype">void</span> get_stat(<a name="_a0"></a><a class="code" href="struct_w_t___c_u_r_s_o_r.html">WT_CURSOR</a> *cursor, <span class="keywordtype">int</span> stat_field, int64_t *valuep);</div><div class="line"><span class="keywordtype">void</span> print_cursor(<a class="code" href="struct_w_t___c_u_r_s_o_r.html">WT_CURSOR</a> *);</div><div class="line"><span class="keywordtype">void</span> print_database_stats(<a name="_a1"></a><a class="code" href="struct_w_t___s_e_s_s_i_o_n.html">WT_SESSION</a> *);</div><div class="line"><span class="keywordtype">void</span> print_derived_stats(<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html">WT_SESSION</a> *);</div><div class="line"><span class="keywordtype">void</span> print_file_stats(<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html">WT_SESSION</a> *);</div><div class="line"><span class="keywordtype">void</span> print_join_cursor_stats(<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html">WT_SESSION</a> *);</div><div class="line"><span class="keywordtype">void</span> print_overflow_pages(<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html">WT_SESSION</a> *);</div><div class="line"><span class="keywordtype">void</span> print_session_stats(<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html">WT_SESSION</a> *);</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *home;</div><div class="line"></div><div class="line"><span class="keywordtype">void</span></div><div class="line">print_cursor(<a class="code" href="struct_w_t___c_u_r_s_o_r.html">WT_CURSOR</a> *cursor)</div><div class="line">{</div><div class="line">    <span class="keyword">const</span> <span class="keywordtype">char</span> *desc, *pvalue;</div><div class="line">    int64_t value;</div><div class="line">    <span class="keywordtype">int</span> ret;</div><div class="line"></div><div class="line">    <span class="keywordflow">while</span> ((ret = cursor-&gt;<a name="a2"></a><a class="code" href="struct_w_t___c_u_r_s_o_r.html#a0503f16bd8f3d05aa3552f229b3a8e1b">next</a>(cursor)) == 0) {</div><div class="line">        error_check(cursor-&gt;<a name="a3"></a><a class="code" href="struct_w_t___c_u_r_s_o_r.html#af85364a5af50b95bbc46c82e72f75c01">get_value</a>(cursor, &amp;desc, &amp;pvalue, &amp;value));</div><div class="line">        <span class="keywordflow">if</span> (value != 0)</div><div class="line">            printf(<span class="stringliteral">&quot;%s=%s\n&quot;</span>, desc, pvalue);</div><div class="line">    }</div><div class="line">    scan_end_check(ret == <a name="a4"></a><a class="code" href="group__wt.html#ga3c9e1b494d95cf34404ab7a974af6bf8">WT_NOTFOUND</a>);</div><div class="line">}</div><div class="line"><span class="keywordtype">void</span></div><div class="line">print_database_stats(<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html">WT_SESSION</a> *session)</div><div class="line">{</div><div class="line">    <a class="code" href="struct_w_t___c_u_r_s_o_r.html">WT_CURSOR</a> *cursor;</div><div class="line"></div><div class="line">    error_check(session-&gt;<a name="a5"></a><a class="code" href="struct_w_t___s_e_s_s_i_o_n.html#afb5b4a69c2c5cafe411b2b04fdc1c75d">open_cursor</a>(session, <span class="stringliteral">&quot;statistics:&quot;</span>, NULL, NULL, &amp;cursor));</div><div class="line"></div><div class="line">    print_cursor(cursor);</div><div class="line">    error_check(cursor-&gt;<a name="a6"></a><a class="code" href="struct_w_t___c_u_r_s_o_r.html#aeea071f192cab12245a50fbe71c3460b">close</a>(cursor));</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">void</span></div><div class="line">print_file_stats(<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html">WT_SESSION</a> *session)</div><div class="line">{</div><div class="line">    <a class="code" href="struct_w_t___c_u_r_s_o_r.html">WT_CURSOR</a> *cursor;</div><div class="line"></div><div class="line">    error_check(session-&gt;<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html#afb5b4a69c2c5cafe411b2b04fdc1c75d">open_cursor</a>(session, <span class="stringliteral">&quot;statistics:table:access&quot;</span>, NULL, NULL, &amp;cursor));</div><div class="line"></div><div class="line">    print_cursor(cursor);</div><div class="line">    error_check(cursor-&gt;<a class="code" href="struct_w_t___c_u_r_s_o_r.html#aeea071f192cab12245a50fbe71c3460b">close</a>(cursor));</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">void</span></div><div class="line">print_join_cursor_stats(<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html">WT_SESSION</a> *session)</div><div class="line">{</div><div class="line">    <a class="code" href="struct_w_t___c_u_r_s_o_r.html">WT_CURSOR</a> *idx_cursor, *join_cursor, *stat_cursor;</div><div class="line"></div><div class="line">    error_check(session-&gt;<a name="a7"></a><a class="code" href="struct_w_t___s_e_s_s_i_o_n.html#a358ca4141d59c345f401c58501276bbb">create</a>(session, <span class="stringliteral">&quot;index:access:idx&quot;</span>, <span class="stringliteral">&quot;columns=(v)&quot;</span>));</div><div class="line">    error_check(session-&gt;<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html#afb5b4a69c2c5cafe411b2b04fdc1c75d">open_cursor</a>(session, <span class="stringliteral">&quot;index:access:idx&quot;</span>, NULL, NULL, &amp;idx_cursor));</div><div class="line">    error_check(idx_cursor-&gt;<a class="code" href="struct_w_t___c_u_r_s_o_r.html#a0503f16bd8f3d05aa3552f229b3a8e1b">next</a>(idx_cursor));</div><div class="line">    error_check(session-&gt;<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html#afb5b4a69c2c5cafe411b2b04fdc1c75d">open_cursor</a>(session, <span class="stringliteral">&quot;join:table:access&quot;</span>, NULL, NULL, &amp;join_cursor));</div><div class="line">    error_check(session-&gt;<a name="a8"></a><a class="code" href="struct_w_t___s_e_s_s_i_o_n.html#ae0ab118df83d173c6a20eb1ea3f3fd84">join</a>(session, join_cursor, idx_cursor, <span class="stringliteral">&quot;compare=gt&quot;</span>));</div><div class="line">    print_cursor(join_cursor);</div><div class="line"></div><div class="line">    error_check(session-&gt;<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html#afb5b4a69c2c5cafe411b2b04fdc1c75d">open_cursor</a>(session, <span class="stringliteral">&quot;statistics:join&quot;</span>, join_cursor, NULL, &amp;stat_cursor));</div><div class="line"></div><div class="line">    print_cursor(stat_cursor);</div><div class="line">    error_check(stat_cursor-&gt;<a class="code" href="struct_w_t___c_u_r_s_o_r.html#aeea071f192cab12245a50fbe71c3460b">close</a>(stat_cursor));</div><div class="line">    error_check(join_cursor-&gt;<a class="code" href="struct_w_t___c_u_r_s_o_r.html#aeea071f192cab12245a50fbe71c3460b">close</a>(join_cursor));</div><div class="line">    error_check(idx_cursor-&gt;<a class="code" href="struct_w_t___c_u_r_s_o_r.html#aeea071f192cab12245a50fbe71c3460b">close</a>(idx_cursor));</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">void</span></div><div class="line">print_session_stats(<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html">WT_SESSION</a> *session)</div><div class="line">{</div><div class="line">    <a class="code" href="struct_w_t___c_u_r_s_o_r.html">WT_CURSOR</a> *stat_cursor;</div><div class="line"></div><div class="line">    error_check(session-&gt;<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html#afb5b4a69c2c5cafe411b2b04fdc1c75d">open_cursor</a>(session, <span class="stringliteral">&quot;statistics:session&quot;</span>, NULL, NULL, &amp;stat_cursor));</div><div class="line"></div><div class="line">    print_cursor(stat_cursor);</div><div class="line">    error_check(stat_cursor-&gt;<a class="code" href="struct_w_t___c_u_r_s_o_r.html#aeea071f192cab12245a50fbe71c3460b">close</a>(stat_cursor));</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">void</span></div><div class="line">print_overflow_pages(<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html">WT_SESSION</a> *session)</div><div class="line">{</div><div class="line">    <a class="code" href="struct_w_t___c_u_r_s_o_r.html">WT_CURSOR</a> *cursor;</div><div class="line">    <span class="keyword">const</span> <span class="keywordtype">char</span> *desc, *pvalue;</div><div class="line">    int64_t value;</div><div class="line"></div><div class="line">    error_check(session-&gt;<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html#afb5b4a69c2c5cafe411b2b04fdc1c75d">open_cursor</a>(session, <span class="stringliteral">&quot;statistics:table:access&quot;</span>, NULL, NULL, &amp;cursor));</div><div class="line"></div><div class="line">    cursor-&gt;<a name="a9"></a><a class="code" href="struct_w_t___c_u_r_s_o_r.html#ad1088d719df40babc1f57d086691ebdc">set_key</a>(cursor, <a name="a10"></a><a class="code" href="group__wt.html#ga079f2d70ac0826f54e36b8535d7194e5">WT_STAT_DSRC_BTREE_OVERFLOW</a>);</div><div class="line">    error_check(cursor-&gt;<a name="a11"></a><a class="code" href="struct_w_t___c_u_r_s_o_r.html#a7e25b2ced2cf3ec68bd5429bf921c79f">search</a>(cursor));</div><div class="line">    error_check(cursor-&gt;<a class="code" href="struct_w_t___c_u_r_s_o_r.html#af85364a5af50b95bbc46c82e72f75c01">get_value</a>(cursor, &amp;desc, &amp;pvalue, &amp;value));</div><div class="line">    printf(<span class="stringliteral">&quot;%s=%s\n&quot;</span>, desc, pvalue);</div><div class="line"></div><div class="line">    error_check(cursor-&gt;<a class="code" href="struct_w_t___c_u_r_s_o_r.html#aeea071f192cab12245a50fbe71c3460b">close</a>(cursor));</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">void</span></div><div class="line">get_stat(<a class="code" href="struct_w_t___c_u_r_s_o_r.html">WT_CURSOR</a> *cursor, <span class="keywordtype">int</span> stat_field, int64_t *valuep)</div><div class="line">{</div><div class="line">    <span class="keyword">const</span> <span class="keywordtype">char</span> *desc, *pvalue;</div><div class="line"></div><div class="line">    cursor-&gt;<a class="code" href="struct_w_t___c_u_r_s_o_r.html#ad1088d719df40babc1f57d086691ebdc">set_key</a>(cursor, stat_field);</div><div class="line">    error_check(cursor-&gt;<a class="code" href="struct_w_t___c_u_r_s_o_r.html#a7e25b2ced2cf3ec68bd5429bf921c79f">search</a>(cursor));</div><div class="line">    error_check(cursor-&gt;<a class="code" href="struct_w_t___c_u_r_s_o_r.html#af85364a5af50b95bbc46c82e72f75c01">get_value</a>(cursor, &amp;desc, &amp;pvalue, valuep));</div><div class="line">}</div><div class="line"><span class="keywordtype">void</span></div><div class="line">print_derived_stats(<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html">WT_SESSION</a> *session)</div><div class="line">{</div><div class="line">    <a class="code" href="struct_w_t___c_u_r_s_o_r.html">WT_CURSOR</a> *cursor;</div><div class="line"></div><div class="line">    error_check(session-&gt;<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html#afb5b4a69c2c5cafe411b2b04fdc1c75d">open_cursor</a>(session, <span class="stringliteral">&quot;statistics:table:access&quot;</span>, NULL, NULL, &amp;cursor));</div><div class="line">    {</div><div class="line">        int64_t ckpt_size, file_size, percent;</div><div class="line">        get_stat(cursor, <a name="a12"></a><a class="code" href="group__wt.html#ga3ba4d6c12abe10285dc3b599f082a4e4">WT_STAT_DSRC_BLOCK_CHECKPOINT_SIZE</a>, &amp;ckpt_size);</div><div class="line">        get_stat(cursor, <a name="a13"></a><a class="code" href="group__wt.html#ga2af5c768712ce6c6b840badd17dd13b9">WT_STAT_DSRC_BLOCK_SIZE</a>, &amp;file_size);</div><div class="line"></div><div class="line">        percent = 0;</div><div class="line">        <span class="keywordflow">if</span> (file_size != 0)</div><div class="line">            percent = 100 * ((file_size - ckpt_size) / file_size);</div><div class="line">        printf(<span class="stringliteral">&quot;Table is %&quot;</span> PRId64 <span class="stringliteral">&quot;%% fragmented\n&quot;</span>, percent);</div><div class="line">    }</div><div class="line"></div><div class="line">    {</div><div class="line">        int64_t app_insert, app_remove, app_update, fs_writes;</div><div class="line"></div><div class="line">        get_stat(cursor, <a name="a14"></a><a class="code" href="group__wt.html#gaec7145b45392656825b8404ae1fb4f46">WT_STAT_DSRC_CURSOR_INSERT_BYTES</a>, &amp;app_insert);</div><div class="line">        get_stat(cursor, <a name="a15"></a><a class="code" href="group__wt.html#gaf9cc721c75f42a110e0f6af104087b4d">WT_STAT_DSRC_CURSOR_REMOVE_BYTES</a>, &amp;app_remove);</div><div class="line">        get_stat(cursor, <a name="a16"></a><a class="code" href="group__wt.html#ga21596e9d2f3d0c992bcade65b85cb5eb">WT_STAT_DSRC_CURSOR_UPDATE_BYTES</a>, &amp;app_update);</div><div class="line"></div><div class="line">        get_stat(cursor, <a name="a17"></a><a class="code" href="group__wt.html#ga212a7e9d219e279da8b10adfaaab2afc">WT_STAT_DSRC_CACHE_BYTES_WRITE</a>, &amp;fs_writes);</div><div class="line"></div><div class="line">        <span class="keywordflow">if</span> (app_insert + app_remove + app_update != 0)</div><div class="line">            printf(<span class="stringliteral">&quot;Write amplification is %.2lf\n&quot;</span>,</div><div class="line">              (<span class="keywordtype">double</span>)fs_writes / (app_insert + app_remove + app_update));</div><div class="line">    }</div><div class="line"></div><div class="line">    error_check(cursor-&gt;<a class="code" href="struct_w_t___c_u_r_s_o_r.html#aeea071f192cab12245a50fbe71c3460b">close</a>(cursor));</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">int</span></div><div class="line">main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[])</div><div class="line">{</div><div class="line">    <a name="_a18"></a><a class="code" href="struct_w_t___c_o_n_n_e_c_t_i_o_n.html">WT_CONNECTION</a> *conn;</div><div class="line">    <a class="code" href="struct_w_t___c_u_r_s_o_r.html">WT_CURSOR</a> *cursor;</div><div class="line">    <a class="code" href="struct_w_t___s_e_s_s_i_o_n.html">WT_SESSION</a> *session;</div><div class="line"></div><div class="line">    home = example_setup(argc, argv);</div><div class="line"></div><div class="line">    error_check(<a name="a19"></a><a class="code" href="group__wt.html#gacbe8d118f978f5bfc8ccb4c77c9e8813">wiredtiger_open</a>(home, NULL, <span class="stringliteral">&quot;create,statistics=(all)&quot;</span>, &amp;conn));</div><div class="line">    error_check(conn-&gt;<a name="a20"></a><a class="code" href="struct_w_t___c_o_n_n_e_c_t_i_o_n.html#adad5965cd4a60f65b5ac01f7ca6d1fc0">open_session</a>(conn, NULL, NULL, &amp;session));</div><div class="line">    error_check(</div><div class="line">      session-&gt;<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html#a358ca4141d59c345f401c58501276bbb">create</a>(session, <span class="stringliteral">&quot;table:access&quot;</span>, <span class="stringliteral">&quot;key_format=S,value_format=S,columns=(k,v)&quot;</span>));</div><div class="line"></div><div class="line">    error_check(session-&gt;<a class="code" href="struct_w_t___s_e_s_s_i_o_n.html#afb5b4a69c2c5cafe411b2b04fdc1c75d">open_cursor</a>(session, <span class="stringliteral">&quot;table:access&quot;</span>, NULL, NULL, &amp;cursor));</div><div class="line">    cursor-&gt;<a class="code" href="struct_w_t___c_u_r_s_o_r.html#ad1088d719df40babc1f57d086691ebdc">set_key</a>(cursor, <span class="stringliteral">&quot;key&quot;</span>);</div><div class="line">    cursor-&gt;<a name="a21"></a><a class="code" href="struct_w_t___c_u_r_s_o_r.html#a27f7cbd0cd3e561f6a145704813ad64c">set_value</a>(cursor, <span class="stringliteral">&quot;value&quot;</span>);</div><div class="line">    error_check(cursor-&gt;<a name="a22"></a><a class="code" href="struct_w_t___c_u_r_s_o_r.html#aac90d9fbcc031570f924db55f8a1cee3">insert</a>(cursor));</div><div class="line">    error_check(cursor-&gt;<a class="code" href="struct_w_t___c_u_r_s_o_r.html#aeea071f192cab12245a50fbe71c3460b">close</a>(cursor));</div><div class="line"></div><div class="line">    error_check(session-&gt;<a name="a23"></a><a class="code" href="struct_w_t___s_e_s_s_i_o_n.html#a6550c9079198955c5071583941c85bbf">checkpoint</a>(session, NULL));</div><div class="line"></div><div class="line">    print_database_stats(session);</div><div class="line"></div><div class="line">    print_file_stats(session);</div><div class="line"></div><div class="line">    print_join_cursor_stats(session);</div><div class="line"></div><div class="line">    print_session_stats(session);</div><div class="line"></div><div class="line">    print_overflow_pages(session);</div><div class="line"></div><div class="line">    print_derived_stats(session);</div><div class="line"></div><div class="line">    error_check(conn-&gt;<a name="a24"></a><a class="code" href="struct_w_t___c_o_n_n_e_c_t_i_o_n.html#af535c517df851eeac8ebf3594d40b545">close</a>(conn, NULL));</div><div class="line"></div><div class="line">    <span class="keywordflow">return</span> (EXIT_SUCCESS);</div><div class="line">}</div></div><!-- fragment --> </div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright (c) 2008-2019 MongoDB, Inc.  All rights reserved.  Contact <a href="mailto:info@wiredtiger.com">info@wiredtiger.com</a> for more information.</li>
  </ul>
</div>
</body>
</html>