All Downloads are FREE. Search and download functionalities are using the official Maven repository.

activities.mongodb-basic-uuid.yaml Maven / Gradle / Ivy

There is a newer version: 4.15.102
Show newest version
# nb -v run driver=mongodb yaml=mongodb-basic-uuid connection=mongodb://127.0.0.1 database=testdb tags=phase:rampup
description: An example of a basic mongo insert and find with UUID

scenarios:
  default:
    - run driver=mongodb tags==phase:rampup cycles===TEMPLATE(rampup-cycles,100000000) threads=auto
    - run driver=mongodb tags==phase:main cycles===TEMPLATE(main-cycles,100000000) threads=auto
bindings:
  seq_uuid: Mod(<>L); ToHashedUUID() -> java.util.UUID; ToString() -> String
  rw_uuid: <long>>; ToHashedUUID() -> java.util.UUID; ToString() -> String
  seq_key: Mod(<>L); ToInt()
  seq_value: Mod(<>L); <>; ToLong()
  rw_key: <long>>; ToInt()
  rw_value: <long>>; <>; ToLong()

blocks:
  - name: rampup
    tags:
      phase: rampup
    statements:
      - rampup-insert: |
          {
            insert: "<>",
            documents: [ { _id: UUID("{seq_uuid}"),
                           key: {seq_key},
                           value: NumberLong({seq_value}) } ]
          }
        params:
          readPreference: primary
        tags:
          name: rampup-insert
  - name: verify
    tags:
      phase: verify
      type: read
    params:
      cl: <>
    statements:
      - verify-find: |
          {
            find: "<>",
            filter: { _id: UUID("{seq_uuid}") }
          }
        verify-fields: _id->seq_uuid, key->seq_key, value->seq_value
        tags:
          name: verify
  - name: main-read
    tags:
      phase: main
      type: read
    params:
      ratio: <>
    statements:
      - main-find: |
          {
            find: "<>",
            filter: { _id: UUID("{rw_uuid}") }
          }
        params:
          readPreference: primary
        tags:
          name: main-find
  - name: main-write
    tags:
      phase: main
      type: write
    params:
      ratio: <>
    statements:
      - main-insert: |
          {
            insert: "<>",
            documents: [ { _id: UUID("{rw_uuid}")
                           key: {rw_key},
                           value: NumberLong({rw_value}) } ]
          }
        params:
          readPreference: primary
        tags:
          name: main-insert




© 2015 - 2024 Weber Informatics LLC | Privacy Policy