Zero  0.1.0
smstats.h
Go to the documentation of this file.
1 /*
2  * (c) Copyright 2011-2013, Hewlett-Packard Development Company, LP
3  */
4 
5 /*<std-header orig-src='shore' incl-file-exclusion='SMSTATS_H'>
6 
7  $Id: smstats.h,v 1.36 2010/09/21 14:26:20 nhall Exp $
8 
9 SHORE -- Scalable Heterogeneous Object REpository
10 
11 Copyright (c) 1994-99 Computer Sciences Department, University of
12  Wisconsin -- Madison
13 All Rights Reserved.
14 
15 Permission to use, copy, modify and distribute this software and its
16 documentation is hereby granted, provided that both the copyright
17 notice and this permission notice appear in all copies of the
18 software, derivative works or modified versions, and any portions
19 thereof, and that both notices appear in supporting documentation.
20 
21 THE AUTHORS AND THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY
22 OF WISCONSIN - MADISON ALLOW FREE USE OF THIS SOFTWARE IN ITS
23 "AS IS" CONDITION, AND THEY DISCLAIM ANY LIABILITY OF ANY KIND
24 FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
25 
26 This software was developed with support by the Advanced Research
27 Project Agency, ARPA order number 018 (formerly 8230), monitored by
28 the U.S. Army Research Laboratory under contract DAAB07-91-C-Q518.
29 Further funding for this work was provided by DARPA through
30 Rome Research Laboratory Contract No. F30602-97-2-0247.
31 
32 */
33 
34 #ifndef __SMSTATS_H
35 #define __SMSTATS_H
36 
37 #include "w_defines.h"
38 #include <array>
39 
40 /* -- do not edit anything above this line -- </std-header>*/
41 
42 // This file is included in sm.h in the middle of the class ss_m
43 // declaration. Member functions are defined in sm.cpp
44 
45 
126 template<typename E>
127 constexpr auto enum_to_base(E e)->typename std::underlying_type<E>::type {
128  return static_cast<typename std::underlying_type<E>::type>(e);
129 }
130 
131 enum class sm_stat_id : size_t {
143  bf_evict,
145  bf_hit_cnt,
146  vol_reads,
147  vol_writes,
152  log_fetches,
153  log_inserts,
159  // nonunique_fingerprints,
160  // unique_fingerprints,
161  bt_find_cnt,
166  bt_grows,
167  bt_shrinks,
168  bt_links,
169  bf_fix_cnt,
178  anchors,
180  // compensate_in_xct,
190  la_log_slow,
195  la_read_time,
202  stat_max // Leave this one here to count the number of stats!
203 };
204 
205 using sm_stats_t = std::array<long, enum_to_base(sm_stat_id::stat_max)>;
206 
207 // CS TODO: move this into some static class instead of global functions
208 void print_sm_stats(sm_stats_t& stats, std::ostream& out);
209 
210 const char* get_stat_name(sm_stat_id s);
211 
212 const char* get_stat_expl(sm_stat_id s);
213 
226  u_long page_size; // bytes in page, including all headers
227 
229  //TODO: SHORE-KITS-API
230  // shore-kits needs max_small_rec; shore-sm-6.0.1 initializes this field at
231  // several places. Make sure Zero similarly initializes max_small_rec
232  u_long max_small_rec; // maximum number of bytes in a "small"
233  // (ie. on one page) record. This is
234  // align(header_len)+align(body_len).
236 
238  u_long buffer_pool_size; // buffer pool size in kilo-bytes
239 
243 
245  u_long exts_on_page;
246 
251 
257  bool logging;
258 
259  friend ostream& operator<<(ostream&, const sm_config_info_t& s);
260 };
261 
262 /*<std-footer incl-file-exclusion='SMSTATS_H'> -- do not edit anything below this line -- */
263 
264 #endif // __SMSTATS_H /*</std-footer>*/
const char * get_stat_expl(sm_stat_id s)
Definition: smstats.cpp:187
u_long page_size
compile-time constant. Settable in
Definition: smstats.h:226
u_long max_btree_entry_size
Largest permissible size in bytes of an index entry (key,value pair)
Definition: smstats.h:242
u_long exts_on_page
Number of extent links on an extent page.
Definition: smstats.h:245
u_long max_small_rec
Data space available on a page of a large record.
Definition: smstats.h:232
Configuration Information.
Definition: smstats.h:221
sm_stat_id
Definition: smstats.h:131
std::array< long, enum_to_base(sm_stat_id::stat_max)> sm_stats_t
Definition: smstats.h:205
void print_sm_stats(sm_stats_t &stats, std::ostream &out)
std::ostream & operator<<(std::ostream &os, const ConfigFile &cf)
Definition: confparser.cpp:83
const char * get_stat_name(sm_stat_id s)
Definition: smstats.cpp:44
u_long lg_rec_page_space
Definition: smstats.h:235
bool logging
True if logging is on.
Definition: smstats.h:257
constexpr auto enum_to_base(E e) -> typename std::underlying_type< E >::type
Definition: smstats.h:127
u_long buffer_pool_size
Size in KB of buffer pool.
Definition: smstats.h:238
u_long pages_per_ext
Number of pages per extent (compile-time constant)
Definition: smstats.h:250