diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2016-03-25 08:19:12 +1100 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2016-03-25 08:19:12 +1100 |
commit | 43e885a0f9a3ad046eae1726b005ca1280624be3 (patch) | |
tree | f03d31a7b36c476484f26ea5259777aeb7b13201 /bench/wtperf/wtperf.h | |
parent | 5cdd3e320cb19cd54111c2572a3d6e33d3009ad4 (diff) | |
parent | 9cf8eb2f15c6df7da90c19c86ccf7516ed126183 (diff) | |
download | mongo-43e885a0f9a3ad046eae1726b005ca1280624be3.tar.gz |
Merge branch 'mongodb-3.4' into mongodb-3.2mongodb-3.2.5
Diffstat (limited to 'bench/wtperf/wtperf.h')
-rw-r--r-- | bench/wtperf/wtperf.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/bench/wtperf/wtperf.h b/bench/wtperf/wtperf.h index 929880b0aef..a2b497b3142 100644 --- a/bench/wtperf/wtperf.h +++ b/bench/wtperf/wtperf.h @@ -94,6 +94,7 @@ typedef struct { int64_t truncate; /* Truncate ratio */ uint64_t truncate_pct; /* Truncate Percent */ uint64_t truncate_count; /* Truncate Count */ + int64_t update_delta; /* Value size change on update */ #define WORKER_INSERT 1 /* Insert */ #define WORKER_INSERT_RMW 2 /* Insert with read-modify-write */ @@ -138,6 +139,7 @@ typedef struct { } THROTTLE_CONFIG; #define LOG_PARTIAL_CONFIG ",log=(enabled=false)" +#define READONLY_CONFIG ",readonly=true" /* * NOTE: If you add any fields to this structure here, you must also add * an initialization in wtperf.c in the default_cfg. @@ -145,7 +147,8 @@ typedef struct { struct __config { /* Configuration structure */ const char *home; /* WiredTiger home */ const char *monitor_dir; /* Monitor output dir */ - const char *partial_config; /* Config string for partial logging */ + char *partial_config; /* Config string for partial logging */ + char *reopen_config; /* Config string for conn reopen */ char *base_uri; /* Object URI */ char **uris; /* URIs if multiple tables */ const char *helium_mount; /* Optional Helium mount point */ @@ -188,7 +191,10 @@ struct __config { /* Configuration structure */ volatile uint32_t totalsec; /* total seconds running */ - u_int has_truncate; /* if there is a truncate workload */ +#define CFG_GROW 0x0001 /* There is a grow workload */ +#define CFG_SHRINK 0x0002 /* There is a shrink workload */ +#define CFG_TRUNCATE 0x0004 /* There is a truncate workload */ + uint32_t flags; /* flags */ /* Queue head for use with the Truncate Logic */ TAILQ_HEAD(__truncate_qh, __truncate_queue_entry) stone_head; @@ -331,7 +337,7 @@ generate_key(CONFIG *cfg, char *key_buf, uint64_t keyno) static inline void extract_key(char *key_buf, uint64_t *keynop) { - sscanf(key_buf, "%" SCNu64, keynop); + (void)sscanf(key_buf, "%" SCNu64, keynop); } /* @@ -364,11 +370,11 @@ dmalloc(size_t len) * Call calloc, dying on failure. */ static inline void * -dcalloc(size_t num, size_t len) +dcalloc(size_t num, size_t size) { void *p; - if ((p = calloc(len, num)) == NULL) + if ((p = calloc(num, size)) == NULL) die(errno, "calloc"); return (p); } @@ -410,11 +416,9 @@ static inline char * dstrndup(const char *str, const size_t len) { char *p; - p = dcalloc(len + 1, 1); - strncpy(p, str, len); - if (p == NULL) - die(errno, "dstrndup"); + p = dcalloc(len + 1, sizeof(char)); + memcpy(p, str, len); return (p); } #endif |