1/*- 2 * Automatically built by dist/s_java_stat. 3 * Only the javadoc comments can be edited. 4 * 5 * See the file LICENSE for redistribution information. 6 * 7 * Copyright (c) 2002,2008 Oracle. All rights reserved. 8 */ 9 10package com.sleepycat.db; 11 12/** 13Cache statistics for a database environment. 14*/ 15public class CacheStats { 16 // no public constructor 17 /* package */ CacheStats() {} 18 19 private int st_gbytes; 20 /** 21 Gigabytes of cache (total cache size is st_gbytes + st_bytes). 22 */ 23 public int getGbytes() { 24 return st_gbytes; 25 } 26 27 private int st_bytes; 28 /** 29 Bytes of cache (total cache size is st_gbytes + st_bytes). 30 */ 31 public int getBytes() { 32 return st_bytes; 33 } 34 35 private int st_ncache; 36 /** 37 Number of caches. 38 */ 39 public int getNumCache() { 40 return st_ncache; 41 } 42 43 private int st_max_ncache; 44 /** 45 Maximum number of caches, as configured with 46 {@link EnvironmentConfig#setCacheMax}. 47 */ 48 public int getMaxNumCache() { 49 return st_max_ncache; 50 } 51 52 private int st_mmapsize; 53 /** 54 Maximum file size for mmap. 55 */ 56 public int getMmapSize() { 57 return st_mmapsize; 58 } 59 60 private int st_maxopenfd; 61 /** 62 Maximum number of open file descriptors. 63 */ 64 public int getMaxOpenfd() { 65 return st_maxopenfd; 66 } 67 68 private int st_maxwrite; 69 /** 70 The maximum number of sequential write operations scheduled by the library 71 when flushing dirty pages from the cache. 72 */ 73 public int getMaxWrite() { 74 return st_maxwrite; 75 } 76 77 private int st_maxwrite_sleep; 78 /** 79 The number of microseconds the thread of control should pause before 80 scheduling further write operations. 81 */ 82 public int getMaxWriteSleep() { 83 return st_maxwrite_sleep; 84 } 85 86 private int st_pages; 87 /** 88 Pages in the cache. 89 */ 90 public int getPages() { 91 return st_pages; 92 } 93 94 private int st_map; 95 /** 96 Requested pages mapped into the process' address space (there is no 97 available information about whether or not this request caused disk I/O, 98 although examining the application page fault rate may be helpful). 99 */ 100 public int getMap() { 101 return st_map; 102 } 103 104 private int st_cache_hit; 105 /** 106 Requested pages found in the cache. 107 */ 108 public int getCacheHit() { 109 return st_cache_hit; 110 } 111 112 private int st_cache_miss; 113 /** 114 Requested pages not found in the cache. 115 */ 116 public int getCacheMiss() { 117 return st_cache_miss; 118 } 119 120 private int st_page_create; 121 /** 122 Pages created in the cache. 123 */ 124 public int getPageCreate() { 125 return st_page_create; 126 } 127 128 private int st_page_in; 129 /** 130 Pages read into the cache. 131 */ 132 public int getPageIn() { 133 return st_page_in; 134 } 135 136 private int st_page_out; 137 /** 138 Pages written from the cache to the backing file. 139 */ 140 public int getPageOut() { 141 return st_page_out; 142 } 143 144 private int st_ro_evict; 145 /** 146 Clean pages forced from the cache. 147 */ 148 public int getRoEvict() { 149 return st_ro_evict; 150 } 151 152 private int st_rw_evict; 153 /** 154 Dirty pages forced from the cache. 155 */ 156 public int getRwEvict() { 157 return st_rw_evict; 158 } 159 160 private int st_page_trickle; 161 /** 162 Dirty pages written using {@link com.sleepycat.db.Environment#trickleCacheWrite Environment.trickleCacheWrite}. 163 */ 164 public int getPageTrickle() { 165 return st_page_trickle; 166 } 167 168 private int st_page_clean; 169 /** 170 Clean pages currently in the cache. 171 */ 172 public int getPageClean() { 173 return st_page_clean; 174 } 175 176 private int st_page_dirty; 177 /** 178 Dirty pages currently in the cache. 179 */ 180 public int getPageDirty() { 181 return st_page_dirty; 182 } 183 184 private int st_hash_buckets; 185 /** 186 Number of hash buckets in buffer hash table. 187 */ 188 public int getHashBuckets() { 189 return st_hash_buckets; 190 } 191 192 private int st_hash_searches; 193 /** 194 Total number of buffer hash table lookups. 195 */ 196 public int getHashSearches() { 197 return st_hash_searches; 198 } 199 200 private int st_hash_longest; 201 /** 202 The longest chain ever encountered in buffer hash table lookups. 203 */ 204 public int getHashLongest() { 205 return st_hash_longest; 206 } 207 208 private int st_hash_examined; 209 /** 210 Total number of hash elements traversed during hash table lookups. 211 */ 212 public int getHashExamined() { 213 return st_hash_examined; 214 } 215 216 private int st_hash_nowait; 217 /** 218 The number of times that a thread of control was able to obtain a 219 hash bucket lock without waiting. 220 */ 221 public int getHashNowait() { 222 return st_hash_nowait; 223 } 224 225 private int st_hash_wait; 226 /** 227 The number of times that a thread of control was forced to wait 228 before obtaining a hash bucket lock. 229 */ 230 public int getHashWait() { 231 return st_hash_wait; 232 } 233 234 private int st_hash_max_nowait; 235 /** 236 The number of times a thread of control was able to obtain the 237 hash bucket lock without waiting on the bucket which had the 238 maximum number of times that a thread of control needed to wait. 239 */ 240 public int getHashMaxNowait() { 241 return st_hash_max_nowait; 242 } 243 244 private int st_hash_max_wait; 245 /** 246 The maximum number of times any hash bucket lock was waited for by 247 a thread of control. 248 */ 249 public int getHashMaxWait() { 250 return st_hash_max_wait; 251 } 252 253 private int st_region_nowait; 254 /** 255 The number of times that a thread of control was able to obtain a 256 region lock without waiting. 257 */ 258 public int getRegionNowait() { 259 return st_region_nowait; 260 } 261 262 private int st_region_wait; 263 /** 264 The number of times that a thread of control was forced to wait 265 before obtaining a region lock. 266 */ 267 public int getRegionWait() { 268 return st_region_wait; 269 } 270 271 private int st_mvcc_frozen; 272 /** 273 Number of buffers frozen. 274 */ 275 public int getMultiversionFrozen() { 276 return st_mvcc_frozen; 277 } 278 279 private int st_mvcc_thawed; 280 /** 281 Number of buffers thawed. 282 */ 283 public int getMultiversionThawed() { 284 return st_mvcc_thawed; 285 } 286 287 private int st_mvcc_freed; 288 /** 289 Number of frozen buffers freed. 290 */ 291 public int getMultiversionFreed() { 292 return st_mvcc_freed; 293 } 294 295 private int st_alloc; 296 /** 297 Number of page allocations. 298 */ 299 public int getAlloc() { 300 return st_alloc; 301 } 302 303 private int st_alloc_buckets; 304 /** 305 Number of hash buckets checked during allocation. 306 */ 307 public int getAllocBuckets() { 308 return st_alloc_buckets; 309 } 310 311 private int st_alloc_max_buckets; 312 /** 313 Maximum number of hash buckets checked during an allocation. 314 */ 315 public int getAllocMaxBuckets() { 316 return st_alloc_max_buckets; 317 } 318 319 private int st_alloc_pages; 320 /** 321 Number of pages checked during allocation. 322 */ 323 public int getAllocPages() { 324 return st_alloc_pages; 325 } 326 327 private int st_alloc_max_pages; 328 /** 329 Maximum number of pages checked during an allocation. 330 */ 331 public int getAllocMaxPages() { 332 return st_alloc_max_pages; 333 } 334 335 private int st_io_wait; 336 /** 337 Number of operations blocked waiting for I/O to complete. 338 */ 339 public int getIoWait() { 340 return st_io_wait; 341 } 342 343 private int st_regsize; 344 /** 345 Individual cache size. 346 */ 347 public int getRegSize() { 348 return st_regsize; 349 } 350 351 /** 352 For convenience, the CacheStats class has a toString method that 353 lists all the data fields. 354 */ 355 public String toString() { 356 return "CacheStats:" 357 + "\n st_gbytes=" + st_gbytes 358 + "\n st_bytes=" + st_bytes 359 + "\n st_ncache=" + st_ncache 360 + "\n st_max_ncache=" + st_max_ncache 361 + "\n st_mmapsize=" + st_mmapsize 362 + "\n st_maxopenfd=" + st_maxopenfd 363 + "\n st_maxwrite=" + st_maxwrite 364 + "\n st_maxwrite_sleep=" + st_maxwrite_sleep 365 + "\n st_pages=" + st_pages 366 + "\n st_map=" + st_map 367 + "\n st_cache_hit=" + st_cache_hit 368 + "\n st_cache_miss=" + st_cache_miss 369 + "\n st_page_create=" + st_page_create 370 + "\n st_page_in=" + st_page_in 371 + "\n st_page_out=" + st_page_out 372 + "\n st_ro_evict=" + st_ro_evict 373 + "\n st_rw_evict=" + st_rw_evict 374 + "\n st_page_trickle=" + st_page_trickle 375 + "\n st_page_clean=" + st_page_clean 376 + "\n st_page_dirty=" + st_page_dirty 377 + "\n st_hash_buckets=" + st_hash_buckets 378 + "\n st_hash_searches=" + st_hash_searches 379 + "\n st_hash_longest=" + st_hash_longest 380 + "\n st_hash_examined=" + st_hash_examined 381 + "\n st_hash_nowait=" + st_hash_nowait 382 + "\n st_hash_wait=" + st_hash_wait 383 + "\n st_hash_max_nowait=" + st_hash_max_nowait 384 + "\n st_hash_max_wait=" + st_hash_max_wait 385 + "\n st_region_nowait=" + st_region_nowait 386 + "\n st_region_wait=" + st_region_wait 387 + "\n st_mvcc_frozen=" + st_mvcc_frozen 388 + "\n st_mvcc_thawed=" + st_mvcc_thawed 389 + "\n st_mvcc_freed=" + st_mvcc_freed 390 + "\n st_alloc=" + st_alloc 391 + "\n st_alloc_buckets=" + st_alloc_buckets 392 + "\n st_alloc_max_buckets=" + st_alloc_max_buckets 393 + "\n st_alloc_pages=" + st_alloc_pages 394 + "\n st_alloc_max_pages=" + st_alloc_max_pages 395 + "\n st_io_wait=" + st_io_wait 396 + "\n st_regsize=" + st_regsize 397 ; 398 } 399} 400