mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
103 lines
4.7 KiB
YAML
103 lines
4.7 KiB
YAML
min_version: "5.17.1"
|
|
|
|
description: |
|
|
This workload emulates a tabular workload with partitions, clusters, and data fields.
|
|
This should be identical to the cql variant except for:
|
|
- We need to URLEncode the `data` and `data_write` bindings because newlines can't be sent in REST calls.
|
|
- There is no instrumentation with the http driver.
|
|
- There is no async mode with the http driver.
|
|
Note that graphql_port should reflect the port where GraphQL API is exposed (defaults to 8080).
|
|
|
|
scenarios:
|
|
default:
|
|
schema: run driver=http tags==block:'schema.*' threads==1 cycles==UNDEF
|
|
rampup: run driver=http tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
|
|
main: run driver=http tags==block:'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: graphql_host=host1
|
|
# multiple hosts: graphql_host=host1,host2,host3
|
|
# multiple weighted hosts: graphql_host=host1:3,host2:7
|
|
weighted_hosts: WeightedStrings('<<graphql_host:stargate>>')
|
|
# http request id
|
|
request_id: ToHashedUUID(); ToString();
|
|
# for ramp-up and verify
|
|
part_layout: Div(<<partsize:1000000>>); ToString() -> String
|
|
clust_layout: Mod(<<partsize:1000000>>); ToString() -> String
|
|
data: HashedFileExtractToString('data/lorem_ipsum_full.txt',50,150); URLEncode();
|
|
# for read
|
|
limit: Uniform(1,10) -> int
|
|
part_read: Uniform(0,<<partcount:100>>)->int; ToString() -> String
|
|
clust_read: Add(1); Uniform(0,<<partsize:1000000>>)->int; ToString() -> String
|
|
# for write
|
|
part_write: Hash(); Uniform(0,<<partcount:100>>)->int; ToString() -> String
|
|
clust_write: Hash(); Add(1); Uniform(0,<<partsize:1000000>>)->int; ToString() -> String
|
|
data_write: Hash(); HashedFileExtractToString('data/lorem_ipsum_full.txt',50,150); URLEncode();
|
|
|
|
blocks:
|
|
schema:
|
|
tags:
|
|
block: schema
|
|
ops:
|
|
create-keyspace:
|
|
method: POST
|
|
uri: <<protocol:http>>://{weighted_hosts}:<<graphql_port:8080>><<path_prefix:>>/graphql-schema
|
|
Accept: "application/json"
|
|
X-Cassandra-Request-Id: "{request_id}"
|
|
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
|
|
Content-Type: "application/json"
|
|
body: |
|
|
{"query":"mutation {\n createKeyspace(name:\"<<keyspace:gqlcf_tabular>>\", replicas: <<rf:1>>, ifNotExists: true)\n}"}
|
|
|
|
create-table:
|
|
method: POST
|
|
uri: <<protocol:http>>://{weighted_hosts}:<<graphql_port:8080>><<path_prefix:>>/graphql-schema
|
|
Accept: "application/json"
|
|
X-Cassandra-Request-Id: "{request_id}"
|
|
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
|
|
Content-Type: "application/json"
|
|
body: |
|
|
{"query":"mutation {\n createTable(\n keyspaceName: \"<<keyspace:gqlcf_tabular>>\"\n tableName: \"<<table:tabular>>\"\n partitionKeys: [{ name: \"part\", type: { basic: TEXT } }]\n clusteringKeys: [{ name: \"clust\", type: { basic: TEXT } }]\n values: [{ name: \"data\", type: { basic: TEXT } }]\n ifNotExists: true\n )\n}\n"}
|
|
|
|
rampup:
|
|
ops:
|
|
rampup-insert:
|
|
method: POST
|
|
uri: <<protocol:http>>://{weighted_hosts}:<<graphql_port:8080>><<path_prefix:>>/graphql/<<keyspace:gqlcf_tabular>>
|
|
Accept: "application/json"
|
|
X-Cassandra-Request-Id: "{request_id}"
|
|
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
|
|
Content-Type: "application/json"
|
|
body: |
|
|
{"query":"mutation {\n insert<<table:tabular>>( value: {part: \"{part_layout}\", clust: \"{clust_layout}\", data: \"{data}\"}) {value {part, clust, data}}}"}
|
|
|
|
main-read:
|
|
params:
|
|
ratio: 5
|
|
ops:
|
|
main-select:
|
|
method: POST
|
|
uri: <<protocol:http>>://{weighted_hosts}:<<graphql_port:8080>><<path_prefix:>>/graphql/<<keyspace:gqlcf_tabular>>
|
|
Accept: "application/json"
|
|
X-Cassandra-Request-Id: "{request_id}"
|
|
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
|
|
Content-Type: "application/json"
|
|
body: |
|
|
{"query":"{<<table:tabular>>(value: {part: \"{part_read}\"}, options: { pageSize: <<limit:10>> }) {values {part, clust, data}}}"}
|
|
|
|
main-write:
|
|
params:
|
|
ratio: 5
|
|
ops:
|
|
main-write:
|
|
method: POST
|
|
uri: <<protocol:http>>://{weighted_hosts}:<<graphql_port:8080>><<path_prefix:>>/graphql/<<keyspace:gqlcf_tabular>>
|
|
Accept: "application/json"
|
|
X-Cassandra-Request-Id: "{request_id}"
|
|
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
|
|
Content-Type: "application/json"
|
|
body: |
|
|
{"query":"mutation {\n insert<<table:tabular>>( value: {part: \"{part_write}\", clust: \"{clust_write}\", data: \"{data_write}\"}) {value {part, clust, data}}}"}
|