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

activities.baselines.http-rest-keyvalue.yaml Maven / Gradle / Ivy

Go to download

A HTTP nosqlbench ActivityType (AT) driver module; This provides the ability to generate HTTP requests with nosqlbench

The newest version!
# nb -v run driver=http yaml=http-rest-keyvalue tags=phase:schema stargate_host=my_stargate_host host=my_stargate_host auth_token=$AUTH_TOKEN
description: |
  This workload emulates a key-value data model and access patterns.
  This should be identical to the cql variant except for:
  - There is no instrumentation with the http driver.
  - There is no async mode with the http driver.

scenarios:
  default:
    schema: run driver=http tags==phase:schema threads==1 cycles==UNDEF
    rampup: run driver=http tags==phase:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
    main: run driver=http tags==phase:main cycles===TEMPLATE(main-cycles,10000000) threads=auto
bindings:
  # To enable an optional weighted set of hosts in place of a load balancer
  # Examples
  #   single host: stargate_host=host1
  #   multiple hosts: stargate_host=host1,host2,host3
  #   multiple weighted hosts: stargate_host=host1:3,host2:7
  weighted_hosts: WeightedStrings('<>')
  # http request id
  request_id: ToHashedUUID(); ToString();

  seq_key: Mod(<>); ToString() -> String
  seq_value: Hash(); Mod(<>); ToString() -> String
  rw_key: <int>>; ToString() -> String
  rw_value: Hash(); <int>>; ToString() -> String

blocks:
  - name: schema
    tags:
      phase: schema
    statements:
      - create-keyspace: POST <>://{weighted_hosts}:<><>/v2/schemas/keyspaces
        Accept: "application/json"
        X-Cassandra-Request-Id: "{request_id}"
        X-Cassandra-Token: "<>"
        Content-Type: "application/json"
        body: |
          {
              "name": "<>",
              "replicas": <>
          }
        tags:
          name: create-keyspace
      - drop-table: DELETE <>://{weighted_hosts}:<><>/v2/schemas/keyspaces/<>/tables/<>
        Accept: "application/json"
        X-Cassandra-Request-Id: "{request_id}"
        X-Cassandra-Token: "<>"
        Content-Type: "application/json"
        tags:
          name: drop-table
        ok-status: "[2-4][0-9][0-9]"
      - create-table: POST <>://{weighted_hosts}:<><>/v2/schemas/keyspaces/<>/tables
        Accept: "application/json"
        X-Cassandra-Request-Id: "{request_id}"
        X-Cassandra-Token: "<>"
        Content-Type: "application/json"
        body: |
          {
              "name": "<>",
              "columnDefinitions": [
                  {
                      "name": "key",
                      "typeDefinition": "text"
                  },
                  {
                      "name": "value",
                      "typeDefinition": "text"
                  }
              ],
              "primaryKey": {
                  "partitionKey": [
                      "key"
                  ]
              },
              "ifNotExists": true
          }
        tags:
          name: create-table
  - tags:
      phase: schema-astra
    statements:
      - create-table-astra: POST <>://{weighted_hosts}:<><>/v2/schemas/keyspaces/<>/tables
        Accept: "application/json"
        X-Cassandra-Request-Id: "{request_id}"
        X-Cassandra-Token: "<>"
        Content-Type: "application/json"
        body: |
          {
              "name": "<>",
              "columnDefinitions": [
                  {
                      "name": "key",
                      "typeDefinition": "text"
                  },
                  {
                      "name": "value",
                      "typeDefinition": "text"
                  }
              ],
              "primaryKey": {
                  "partitionKey": [
                      "key"
                  ]
              },
              "ifNotExists": true
          }
        tags:
          name: create-table-astra
  - name: rampup
    tags:
      phase: rampup
    statements:
      - rampup-insert: POST <>://{weighted_hosts}:<><>/v2/keyspaces/<>/<>
        Accept: "application/json"
        X-Cassandra-Request-Id: "{request_id}"
        X-Cassandra-Token: "<>"
        Content-Type: "application/json"
        body: |
          {
            "key": "{seq_key}",
            "value": "{seq_value}"
          }
        tags:
          name: rampup-insert
  - name: main-read
    tags:
      phase: main
      type: read
    params:
      ratio: <>
    statements:
      - main-select: GET <>://{weighted_hosts}:<><>/v2/keyspaces/<>/<>/{rw_key}
        Accept: "application/json"
        X-Cassandra-Request-Id: "{request_id}"
        X-Cassandra-Token: "<>"
        Content-Type: "application/json"
        tags:
          name: main-select
        ok-status: "[2-4][0-9][0-9]"
  - name: main-write
    tags:
      phase: main
      type: write
    params:
      ratio: <>
    statements:
      - main-write: POST <>://{weighted_hosts}:<><>/v2/keyspaces/<>/<>
        Accept: "application/json"
        X-Cassandra-Request-Id: "{request_id}"
        X-Cassandra-Token: "<>"
        Content-Type: "application/json"
        body: |
          {
            "key": "{rw_key}",
            "value": "{rw_value}"
          }
        tags:
          name: main-write




© 2015 - 2025 Weber Informatics LLC | Privacy Policy