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

activities.documents-api.http-docsapi-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

There is a newer version: 4.15.102
Show newest version
# nb -v run driver=http yaml=http-docsapi-keyvalue tags=phase:schema stargate_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:
  - Schema creation with the Docs API, we don't use cql because the Docs API is opinionated about schema.
  - There is no instrumentation with the http driver.
  - There is no async mode with the http driver.
  Note that stargate_port should reflect the port where the Docs API is exposed (defaults to 8082). 

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:
  - 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
      - delete-docs-collection : DELETE <>://{weighted_hosts}:<><>/v2/namespaces/<>/collections/<>
        Accept: "application/json"
        X-Cassandra-Request-Id: "{request_id}"
        X-Cassandra-Token: "<>"
        tags:
          name: delete-table
        ok-status: "[2-4][0-9][0-9]"
      - create-docs-collection : POST <>://{weighted_hosts}:<><>/v2/namespaces/<>/collections
        Accept: "application/json"
        X-Cassandra-Request-Id: "{request_id}"
        X-Cassandra-Token: "<>"
        Content-Type: "application/json"
        body: |
          {
              "name": "<>"
          }
        tags:
          name: create-table

  - name: rampup
    tags:
      phase: rampup
    statements:
      - rampup-insert: PUT <>://{weighted_hosts}:<><>/v2/namespaces/<>/collections/<>/{seq_key}
        Accept: "application/json"
        X-Cassandra-Request-Id: "{request_id}"
        X-Cassandra-Token: "<>"
        Content-Type: "application/json"
        body: |
            {
              "{seq_key}":"{seq_value}"
            }
        tags:
          name: rampup-insert

  - name: main-read
    tags:
      phase: main
      type: read
    params:
      ratio: <>
    statements:
      - main-select: GET <>://{weighted_hosts}:<><>/v2/namespaces/<>/collections/<>/{rw_key}
        Accept: "application/json"
        X-Cassandra-Request-Id: "{request_id}"
        X-Cassandra-Token: "<>"
        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: PUT <>://{weighted_hosts}:<><>/v2/namespaces/<>/collections/<>/{rw_key}
        Accept: "application/json"
        X-Cassandra-Request-Id: "{request_id}"
        X-Cassandra-Token: "<>"
        Content-Type: "application/json"
        body: |
            {
              "{rw_key}":"{rw_value}"
            }
        tags:
          name: main-write




© 2015 - 2025 Weber Informatics LLC | Privacy Policy