summaryrefslogtreecommitdiff
path: root/bench
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2015-08-03 07:56:58 -0400
committerKeith Bostic <keith@wiredtiger.com>2015-08-03 07:56:58 -0400
commite0eeb74df35c5c42d00f7402834188948261b315 (patch)
treee8db87878c4972a7ac0a444fc84976d90d78ecf0 /bench
parent06e5b9baf07ea5cf9d5f966eba14cbfb835f62b7 (diff)
downloadmongo-e0eeb74df35c5c42d00f7402834188948261b315.tar.gz
wtperf_truncate.c 61 Warning 524: Loss of precision (assignment)
(double to unsigned long long) wtperf_truncate.c 61 Info 732: Loss of sign (assignment) (double to unsigned long long) Fix a comment.
Diffstat (limited to 'bench')
-rw-r--r--bench/wtperf/wtperf.h3
-rw-r--r--bench/wtperf/wtperf_truncate.c4
2 files changed, 2 insertions, 5 deletions
diff --git a/bench/wtperf/wtperf.h b/bench/wtperf/wtperf.h
index 6d4720c86f7..58dc65388ae 100644
--- a/bench/wtperf/wtperf.h
+++ b/bench/wtperf/wtperf.h
@@ -95,7 +95,7 @@ typedef struct {
int64_t ops_per_txn;
int64_t truncate; /* Truncate ratio */
uint64_t truncate_pct; /* Truncate Percent */
- uint64_t truncate_count; /* Truncate Percent */
+ uint64_t truncate_count; /* Truncate Count */
#define WORKER_INSERT 1 /* Insert */
#define WORKER_INSERT_RMW 2 /* Insert with read-modify-write */
@@ -108,7 +108,6 @@ typedef struct {
/* Steering items for the truncate workload */
typedef struct __truncate_struct TRUNCATE_CONFIG;
struct __truncate_struct {
- double truncation_percentage;
uint64_t stone_gap;
uint64_t needed_stones;
uint64_t final_stone_gap;
diff --git a/bench/wtperf/wtperf_truncate.c b/bench/wtperf/wtperf_truncate.c
index 2599d46cbd9..0d5d1045e1e 100644
--- a/bench/wtperf/wtperf_truncate.c
+++ b/bench/wtperf/wtperf_truncate.c
@@ -54,11 +54,9 @@ setup_truncate(CONFIG *cfg, CONFIG_THREAD *thread, WT_SESSION *session) {
session, cfg->uris[0], NULL, NULL, &cursor)) != 0)
goto err;
- /* Truncation percentage value. eg 10% is 0.1. */
- trunc_cfg->truncation_percentage = (double)workload->truncate_pct / 100;
/* How many entries between each stone. */
trunc_cfg->stone_gap =
- workload->truncate_count * trunc_cfg->truncation_percentage;
+ (workload->truncate_count * workload->truncate_pct) / 100;
/* How many stones we need. */
trunc_cfg->needed_stones =
workload->truncate_count / trunc_cfg->stone_gap;