Skip to content

Commit

Permalink
m0crate kv(index) test fixes. (Seagate#461)
Browse files Browse the repository at this point in the history
* Removed unwanted info from kv test run o/p, added KEY_SIZE support.
* Added m0crate index value_size changes.
* Cleaned record size changes and added changes for max key and value.
* Added changes for total op time and time per ops in ns.
* Removed RECORD_SIZE and MAX_RSIZE from tests/*.yaml files.

Signed-off-by: somnathbghule <somnath.b.ghule@seagate.com>
  • Loading branch information
somnathbghule authored and andriytk committed Apr 1, 2021
1 parent 0399cb9 commit 5c9520b
Show file tree
Hide file tree
Showing 13 changed files with 708 additions and 275 deletions.
16 changes: 15 additions & 1 deletion motr/m0crate/crate.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ const int cr_default_nr_thread = 1;
const short cr_default_read_frac = 50;
const bcnt_t cr_default_blocksize = 16 * 1024;
const bcnt_t cr_default_csum_size = 16;
const bcnt_t cr_default_key_size = sizeof(struct m0_fid);
const bcnt_t cr_default_max_ksize = 1 << 10; /* default upper limit for key_size parameter. i.e 1KB */
const bcnt_t cr_default_max_vsize = 1 << 20; /* default upper limit for value_size parameter. i.e 1MB */


const char *cr_workload_name[CWT_NR] = {
Expand Down Expand Up @@ -224,6 +227,16 @@ int workload_init(struct workload *w, enum cr_workload_type wtype)
w->cw_nr_dir = cr_default_nr_dir;
w->cw_read_frac = cr_default_read_frac;

/* set default values before yaml parsing */
if (wtype == CWT_INDEX) {
struct m0_workload_index *wit = w->u.cw_index;
wit->key_size = cr_default_key_size;
/* default value_size is -1 i.e random */
wit->value_size = -1;
wit->max_key_size = cr_default_max_ksize;
wit->max_value_size = cr_default_max_vsize;
}

return wop(w)->wto_init(w);
}

Expand Down Expand Up @@ -380,7 +393,8 @@ static void workload_run(struct workload *w)
w->cw_name, w->cw_type);
cr_log(CLL_INFO, "random seed: %u\n", w->cw_rstate);
cr_log(CLL_INFO, "number of threads: %u\n", w->cw_nr_thread);
if (CWT_IO != w->cw_type) {
/* Following params not applicable to IO and INDEX tests */
if (CWT_IO != w->cw_type && CWT_INDEX != w->cw_type) {
cr_log(CLL_INFO, "average size: %llu\n", w->cw_avg);
cr_log(CLL_INFO, "maximal size: %llu\n", w->cw_max);
/*
Expand Down
9 changes: 7 additions & 2 deletions motr/m0crate/crate_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ struct m0_workload_index {
int num_kvs;
int mode;
int opcode;
int record_size;
int opcode_prcnt[CRATE_OP_TYPES];
int next_records;

Expand All @@ -102,11 +101,17 @@ struct m0_workload_index {
struct m0_fid key_prefix;
int keys_count;

/** Added to set key_size and value_size parameter from .yaml file. */
int key_size;
int value_size;
int max_key_size;
int max_value_size;
int min_key_size;

bool keys_ordered;

struct m0_fid index_fid;

int max_record_size;
uint64_t seed;
};

Expand Down
Loading

0 comments on commit 5c9520b

Please sign in to comment.