From 91578c524cbf6b080221ea1ff440004b5cd3dfe2 Mon Sep 17 00:00:00 2001 From: Eric Borczuk Date: Fri, 21 May 2021 13:29:18 -0400 Subject: [PATCH] Add JSON API keyvalue workload --- .../documents-api/http-docsapi-keyvalue.yaml | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 driver-http/src/main/resources/activities/documents-api/http-docsapi-keyvalue.yaml diff --git a/driver-http/src/main/resources/activities/documents-api/http-docsapi-keyvalue.yaml b/driver-http/src/main/resources/activities/documents-api/http-docsapi-keyvalue.yaml new file mode 100644 index 000000000..91aa31311 --- /dev/null +++ b/driver-http/src/main/resources/activities/documents-api/http-docsapi-keyvalue.yaml @@ -0,0 +1,106 @@ +# nb -v run driver=http yaml=http-docsapi-keyvalue tags=phase:schema host=my_stargate_host 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: + - run driver=http tags==phase:schema threads==1 cycles==UNDEF + - run driver=http tags==phase:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto + - 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 + - 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 + + - 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