Skip to content

emc-mongoose/mongoose-load-step-weighted

Repository files navigation

Gitter chat Issue Tracker CI status Tag Maven metadata URL Sonatype Nexus (Releases) Docker Pulls

Introduction

Frequently there's a requirement to perform a specific load which may be defined by a ratio between different operation types. For example the load step may be described as:

  • 20 % write operations
  • 80 % read operations

Requirements

  1. Ability to specify the relative operations weight for a set of load sub-steps

Approach

The weighted load is implemented as a specific scenario step:

WeightedLoad
    .append(weightedWriteConfig)
    .append(weightedReadConfig)
    .run();

Internally, the weighted load step contains several load generators (for each configuration element supplied) and single load step context. The load step context contains the weight throttle shared among the load generators configured.

Configuration

The configuration option load-generator-weight should be used to set the relative operations weight for the given load generator. The actual weight is calculated as the specified weight value divided by the weights sum.

var weightedWriteConfig = {
    ...
    "load": {
        "op": {
            "weight": 20
        }
    },
    ...
};
var weightedReadConfig = {
    ...
    "load": {
        "op": {
            "weight": 80,
            "type": "read"
        }
    },
    ...
};

By default weights are distributed evenly between steps. For example

  • if 1 step - weight == 100%
  • if 2 steps - weight == 50% for each
  • if 3 steps - weight == 33% for each, etc.

Notes

  • Full example may be found in the example/scenario/js/types/weighted.js scenario file.
  • Weight throttle will never permit the operations if the corresponding weight is 0

Limitations

  1. Weighted load step should contain at least 2 configuration elements.

Output

Specific log messages:

  1. Run the weighted load step "<STEP_ID>"
  2. Weighted load step "<STEP_ID>" started
  3. Weighted load step "<STEP_ID>" done
  4. Weighted load step "<STEP_ID>" timeout

Jar & Sources

https://mvnrepository.com/artifact/com.github.emc-mongoose/mongoose-load-step-weighted