Motr  M0
Workload module for client DIX
Collaboration diagram for Workload module for client DIX:

Crate index workload overview.

Crate execution for index measurements consists of two parts:

  1. Warmup.
  2. Common operations.

Warmup is supposed to prepare index to workload. For example, if we have to measure over fragmented index, we should setup next parameters:

NUM_KVP: 8
WARMUP_PUT_CNT: 1024
WARMUP_DEL_RATIO: 2

It is means, that crate performs next operations:

1024 PUT x 8 kv/op (sequentially)
1024/2 DEL x 8 kv/op (randomly)

Common operations are executed randomly (see cr_op_selector). Each operaion has 'percents' of total operations count (OP_COUNT). Total number of keys in use are calculated by OP_COUNT and NUM_KVP. OP_COUNT can be "unlimited" TODO: for now, it means INT_MAX / (128 * NUM_KVP) operations.

Crate index workload detailed description.

Workload has following parameters:

Operation order (see cr_idx_w_select_op)

Operations are executed in round-robin manner or randomly. If crate can't find appropriate keys for operation then it marks operation as "pending". Selector knows about it and can unmark pending ops, if it cannot find appropriate operations.

Keys order

Keys can be generated sequentially or randomly. There are two functions: cr_idx_w_find_rnd_k and cr_idx_w_find_seq_k. They both have the same signature, but different logic.

cr_idx_w_find_seq_k

This function selects next keys from starting key to nr_keys (the end of keys space). Starting key value depends on operation type: readonly operations (GET,NEXT) should store last key from previous key sequence; other operations (PUT,DEL) starts from first key. Anyway, they iterate over all available keys and fill key list.

cr_idx_w_find_rnd_k

This function selects random key, puts it in the key list and does it again until list is full or bitmap is full.

Different logic for different operations (see struct cr_idx_w_ops).

This struct describes how operation should be prepared for execution and how they change storage state.

Measurements

Currently, only execution time is measured during the test. It measures with m0_time* functions. Crate prints result to stdout when test is finished.

Logging

crate has own logging system, which based on fprintf(stderr...). (see crlog and see cr_log).

Execution time limits

There are two ways to limit execution time. The first, is operations time limit, which checks after operation executed (as described in HLD). The second way uses the watchdog, which detects staled client operations.