activities.cockroachdb-basic.yaml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of driver-cockroachdb Show documentation
Show all versions of driver-cockroachdb Show documentation
A CockroachDB ActivityType driver for http://nosqlbench.io/
# java -jar nb.jar run driver=cockroachdb workload=cockroachdb-basic tags=phase:rampup cycles=10 serverName=localhost
# java -jar nb.jar run driver=cockroachdb workload=cockroachdb-basic tags=phase:main cycles=10 serverName=localhost
description: An example of a basic cockroach insert
scenarios:
default:
- run driver=cockroachdb tags==phase:main threads=auto cycles===<>
serverName=localhost connectionpool=hikari
errors=SQLTransient.*:warn,count,retry;.*0800.*:warn,count,retry;.*40001:count,retry;stop
rampup:
- run driver=cockroachdb tags==phase:rampup threads=auto cycles===<>
serverName=localhost connectionpool=hikari
errors=SQLTransient.*:warn,count,retry;.*0800.*:warn,count,retry;.*40001:count,retry;stop
schema:
- run driver=cockroachdb tags==phase:schema threads===1 serverName=localhost
bindings:
seq_key: Mod(<>L); ToInt()
seq_value: Mod(<>L); <>; ToString() -> String
rw_key: <long>>; ToInt()
rw_value: <int>>; <>; ToString() -> String
blocks:
- name: schema
tags:
phase: schema
params:
statements:
- create-database: |
CREATE DATABASE <>;
tags:
name: create-database
- create-table: |
CREATE TABLE IF NOT EXISTS <>.<> (
code STRING PRIMARY KEY,
amount INTEGER
);
tags:
name: create-table
- name: rampup
tags:
phase: rampup
params:
statements:
- rampup-insert: |
INSERT INTO "<>"."<>"
(code, amount) VALUES ('{seq_key}', {seq_value})
ON CONFLICT (code) DO NOTHING;
params:
tags:
name: rampup-insert
- name: main-read
tags:
phase: main
type: read
params:
ratio: <>
statements:
- main-find: |
SELECT code, amount FROM "<>"."<>"
WHERE code = '{rw_key}' AND amount = {rw_value};
params:
tags:
name: main-find
- name: main-write
tags:
phase: main
type: write
params:
ratio: <>
statements:
- main-insert: |
UPDATE "<>"."<>" SET amount = {seq_value} WHERE code = '{seq_key}';
params:
tags:
name: main-insert