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('<>') # http request id request_id: ToHashedUUID(); ToString(); # for ramp-up and verify part_layout: Div(<>); ToString() -> String clust_layout: Mod(<>); ToString() -> String data: HashedFileExtractToString('data/lorem_ipsum_full.txt',50,150); URLEncode(); # for read limit: Uniform(1,10) -> int part_read: Uniform(0,<>)->int; ToString() -> String clust_read: Add(1); Uniform(0,<>)->int; ToString() -> String # for write part_write: Hash(); Uniform(0,<>)->int; ToString() -> String clust_write: Hash(); Add(1); Uniform(0,<>)->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: <>://{weighted_hosts}:<><>/graphql-schema Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" Content-Type: "application/json" body: | {"query":"mutation {\n createKeyspace(name:\"<>\", replicas: <>, ifNotExists: true)\n}"} create-table: method: POST uri: <>://{weighted_hosts}:<><>/graphql-schema Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" Content-Type: "application/json" body: | {"query":"mutation {\n createTable(\n keyspaceName: \"<>\"\n tableName: \"<>\"\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: <>://{weighted_hosts}:<><>/graphql/<> Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" Content-Type: "application/json" body: | {"query":"mutation {\n insert<>( value: {part: \"{part_layout}\", clust: \"{clust_layout}\", data: \"{data}\"}) {value {part, clust, data}}}"} main-read: params: ratio: 5 ops: main-select: method: POST uri: <>://{weighted_hosts}:<><>/graphql/<> Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" Content-Type: "application/json" body: | {"query":"{<>(value: {part: \"{part_read}\"}, options: { pageSize: <> }) {values {part, clust, data}}}"} main-write: params: ratio: 5 ops: main-write: method: POST uri: <>://{weighted_hosts}:<><>/graphql/<> Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" Content-Type: "application/json" body: | {"query":"mutation {\n insert<>( value: {part: \"{part_write}\", clust: \"{clust_write}\", data: \"{data_write}\"}) {value {part, clust, data}}}"}