Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flatten the round descriptions in the benchmark configuration #636

Closed
aklenik opened this issue Nov 5, 2019 · 0 comments · Fixed by #639
Closed

Flatten the round descriptions in the benchmark configuration #636

aklenik opened this issue Nov 5, 2019 · 0 comments · Fixed by #639
Assignees
Labels
component/core Related to the core code-base enhancement New feature or request locked Someone is already working on it
Milestone

Comments

@aklenik
Copy link
Contributor

aklenik commented Nov 5, 2019

Context

The round descriptions in the benchmark configuration file use an array notation for some attributes as shorthand for reusing callback and arguments attributes values.
YAML anchors can achieve the same, with the following benefits:

  1. The reuse is explicit and more flexible (anchors can be used anywhere, making every part of the config file "extendable").
  2. The resolving of anchors happens when the YAML is loaded, so the core round processing code can be simplified.

Expected Behavior

The round descriptions don't allow using array notation.

Actual Behavior

The round descriptions allow using array notation.

Possible Fix

Take the following config, for example:

test:
    clients:
        type: local
        number: 1
    rounds:
    - label: init
      txNumber: [100, 200, 300]
      rateControl: [{ type: 'fixed-rate', opts: { tps: 20 } }, { type: 'fixed-rate', opts: { tps: 40 } }, { type: 'fixed-rate', opts: { tps: 60 } }]
      callback: ../init.js
      arguments:
          arg1: 100
          arg2: text
          arg3: text2

The same with YAML anchors and aliases would look like this:

definitions:
    initRound: &init-round
        label: init
        txNumber: 100
        rateControl:
            type: fixed-rate
            opts:
                tps: 20
        callback: ../init.js
        arguments:
            arg1: 100
            arg2: text
            arg3: text2
test:
    clients:
        type: local
        number: 2
    rounds:
    - <<: *init-round
    - <<: *init-round
      txNumber: 200
      rateControl:
          opts:
              tps: 40
    - <<: *init-round
      txNumber: 300
      rateControl:
          opts:
              tps: 60

A few things to note:

  1. Configuration files could be decomposed any way the user wants, Caliper doesn't enforce any (unnecessary) structure.
  2. The differences between the rounds are more evident.

Your Environment

  • Version used: 0.2.0
@aklenik aklenik added enhancement New feature or request component/core Related to the core code-base labels Nov 5, 2019
@aklenik aklenik added this to the v0.3.0 milestone Nov 5, 2019
@aklenik aklenik self-assigned this Nov 5, 2019
@aklenik aklenik added the locked Someone is already working on it label Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/core Related to the core code-base enhancement New feature or request locked Someone is already working on it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant