summaryrefslogtreecommitdiff
path: root/src/include/stat.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/stat.h')
-rw-r--r--src/include/stat.h107
1 files changed, 83 insertions, 24 deletions
diff --git a/src/include/stat.h b/src/include/stat.h
index 68879206851..d0b0b60585a 100644
--- a/src/include/stat.h
+++ b/src/include/stat.h
@@ -79,9 +79,9 @@
* those structures regardless of the specific statistic structure we're working
* with, by translating statistics structure field names to structure offsets.
*
- * Translate a statistic's value name to an offset.
+ * Translate a statistic's value name to an offset in the array.
*/
-#define WT_STATS_FIELD_TO_SLOT(stats, fld) \
+#define WT_STATS_FIELD_TO_OFFSET(stats, fld) \
(int)(&(stats)[0]->fld - (int64_t *)(stats)[0])
/*
@@ -140,38 +140,54 @@ __wt_stats_clear(void *stats_arg, int slot)
#define WT_STAT_ENABLED(session) (S2C(session)->stat_flags != 0)
#define WT_STAT_READ(stats, fld) \
- __wt_stats_aggregate(stats, WT_STATS_FIELD_TO_SLOT(stats, fld))
+ __wt_stats_aggregate(stats, WT_STATS_FIELD_TO_OFFSET(stats, fld))
#define WT_STAT_WRITE(session, stats, fld, v) do { \
if (WT_STAT_ENABLED(session)) \
(stats)->fld = (int64_t)(v); \
} while (0)
-#define WT_STAT_DECRV(session, stats, fld, value) do { \
+#define WT_STAT_DECRV_BASE(session, stat, fld, value) do { \
if (WT_STAT_ENABLED(session)) \
- (stats)[WT_STATS_SLOT_ID(session)]->fld -= (int64_t)(value); \
+ (stat)->fld -= (int64_t)(value); \
} while (0)
-#define WT_STAT_DECRV_ATOMIC(session, stats, fld, value) do { \
+#define WT_STAT_DECRV_ATOMIC_BASE(session, stat, fld, value) do { \
+ if (WT_STAT_ENABLED(session)) \
+ __wt_atomic_subi64(&(stat)->fld, (int64_t)(value)); \
+} while (0)
+#define WT_STAT_INCRV_BASE(session, stat, fld, value) do { \
+ if (WT_STAT_ENABLED(session)) \
+ (stat)->fld += (int64_t)(value); \
+} while (0)
+#define WT_STAT_INCRV_ATOMIC_BASE(session, stat, fld, value) do { \
if (WT_STAT_ENABLED(session)) \
- __wt_atomic_subi64(&(stats)[WT_STATS_SLOT_ID(session)]->fld, \
- (int64_t)(value)); \
+ __wt_atomic_addi64(&(stat)->fld, (int64_t)(value)); \
+} while (0)
+
+#define WT_STAT_DECRV(session, stats, fld, value) do { \
+ WT_STAT_DECRV_BASE( \
+ session, (stats)[(session)->stat_bucket], fld, value); \
+} while (0)
+#define WT_STAT_DECRV_ATOMIC(session, stats, fld, value) do { \
+ WT_STAT_DECRV_ATOMIC_BASE( \
+ session, (stats)[(session)->stat_bucket], fld, value); \
} while (0)
#define WT_STAT_DECR(session, stats, fld) \
WT_STAT_DECRV(session, stats, fld, 1)
+
#define WT_STAT_INCRV(session, stats, fld, value) do { \
- if (WT_STAT_ENABLED(session)) \
- (stats)[WT_STATS_SLOT_ID(session)]->fld += (int64_t)(value); \
+ WT_STAT_INCRV_BASE( \
+ session, (stats)[(session)->stat_bucket], fld, value); \
} while (0)
#define WT_STAT_INCRV_ATOMIC(session, stats, fld, value) do { \
- if (WT_STAT_ENABLED(session)) \
- __wt_atomic_addi64(&(stats)[WT_STATS_SLOT_ID(session)]->fld, \
- (int64_t)(value)); \
+ WT_STAT_INCRV_ATOMIC_BASE( \
+ session, (stats)[(session)->stat_bucket], fld, value); \
} while (0)
#define WT_STAT_INCR(session, stats, fld) \
WT_STAT_INCRV(session, stats, fld, 1)
#define WT_STAT_SET(session, stats, fld, value) do { \
if (WT_STAT_ENABLED(session)) { \
__wt_stats_clear(stats, \
- WT_STATS_FIELD_TO_SLOT(stats, fld)); \
+ WT_STATS_FIELD_TO_OFFSET(stats, fld)); \
(stats)[0]->fld = (int64_t)(value); \
} \
} while (0)
@@ -179,18 +195,24 @@ __wt_stats_clear(void *stats_arg, int slot)
/*
* Update connection handle statistics if statistics gathering is enabled.
*/
-#define WT_STAT_CONN_DECR(session, fld) \
- WT_STAT_DECR(session, S2C(session)->stats, fld)
-#define WT_STAT_CONN_DECR_ATOMIC(session, fld) \
- WT_STAT_DECRV_ATOMIC(session, S2C(session)->stats, fld, 1)
#define WT_STAT_CONN_DECRV(session, fld, value) \
- WT_STAT_DECRV(session, S2C(session)->stats, fld, value)
-#define WT_STAT_CONN_INCR(session, fld) \
- WT_STAT_INCR(session, S2C(session)->stats, fld)
-#define WT_STAT_CONN_INCR_ATOMIC(session, fld) \
- WT_STAT_INCRV_ATOMIC(session, S2C(session)->stats, fld, 1)
+ WT_STAT_DECRV_BASE(session, \
+ S2C(session)->stats[(session)->stat_bucket], fld, value)
+#define WT_STAT_CONN_DECR_ATOMIC(session, fld) \
+ WT_STAT_DECRV_ATOMIC_BASE(session, \
+ S2C(session)->stats[(session)->stat_bucket], fld, 1)
+#define WT_STAT_CONN_DECR(session, fld) \
+ WT_STAT_CONN_DECRV(session, fld, 1)
+
#define WT_STAT_CONN_INCRV(session, fld, value) \
- WT_STAT_INCRV(session, S2C(session)->stats, fld, value)
+ WT_STAT_INCRV_BASE(session, \
+ S2C(session)->stats[(session)->stat_bucket], fld, value)
+#define WT_STAT_CONN_INCR_ATOMIC(session, fld) \
+ WT_STAT_INCRV_ATOMIC_BASE(session, \
+ S2C(session)->stats[(session)->stat_bucket], fld, 1)
+#define WT_STAT_CONN_INCR(session, fld) \
+ WT_STAT_CONN_INCRV(session, fld, 1)
+
#define WT_STAT_CONN_SET(session, fld, value) \
WT_STAT_SET(session, S2C(session)->stats, fld, value)
@@ -263,6 +285,10 @@ struct __wt_connection_stats {
int64_t block_byte_write_checkpoint;
int64_t block_map_read;
int64_t block_byte_map_read;
+ int64_t cache_read_app_count;
+ int64_t cache_read_app_time;
+ int64_t cache_write_app_count;
+ int64_t cache_write_app_time;
int64_t cache_bytes_image;
int64_t cache_bytes_inuse;
int64_t cache_bytes_other;
@@ -356,6 +382,21 @@ struct __wt_connection_stats {
int64_t dh_sweeps;
int64_t dh_session_handles;
int64_t dh_session_sweeps;
+ int64_t lock_checkpoint_count;
+ int64_t lock_checkpoint_wait_application;
+ int64_t lock_checkpoint_wait_internal;
+ int64_t lock_handle_list_count;
+ int64_t lock_handle_list_wait_application;
+ int64_t lock_handle_list_wait_internal;
+ int64_t lock_metadata_count;
+ int64_t lock_metadata_wait_application;
+ int64_t lock_metadata_wait_internal;
+ int64_t lock_schema_count;
+ int64_t lock_schema_wait_application;
+ int64_t lock_schema_wait_internal;
+ int64_t lock_table_count;
+ int64_t lock_table_wait_application;
+ int64_t lock_table_wait_internal;
int64_t log_slot_switch_busy;
int64_t log_slot_closes;
int64_t log_slot_races;
@@ -518,6 +559,24 @@ struct __wt_dsrc_stats {
int64_t cache_write;
int64_t cache_write_restore;
int64_t cache_eviction_clean;
+ int64_t cache_state_gen_avg_gap;
+ int64_t cache_state_avg_written_size;
+ int64_t cache_state_pages_clean;
+ int64_t cache_state_gen_current;
+ int64_t cache_state_pages_dirty;
+ int64_t cache_state_root_entries;
+ int64_t cache_state_pages_internal;
+ int64_t cache_state_pages_leaf;
+ int64_t cache_state_gen_max_gap;
+ int64_t cache_state_max_pagesize;
+ int64_t cache_state_min_written_size;
+ int64_t cache_state_smaller_alloc_size;
+ int64_t cache_state_memory;
+ int64_t cache_state_queued;
+ int64_t cache_state_not_queueable;
+ int64_t cache_state_refs_skipped;
+ int64_t cache_state_root_size;
+ int64_t cache_state_pages;
int64_t compress_read;
int64_t compress_write;
int64_t compress_write_fail;