Merge pull request #971 from nosqlbench/nosqlbench-969-docexamples

minimum fix needed for example in docs
This commit is contained in:
Jonathan Shook 2023-02-01 10:59:24 -06:00 committed by GitHub
commit 00d27c38d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 72 additions and 86 deletions

View File

@ -6,13 +6,13 @@ description: |
scenarios: scenarios:
default: default:
schema: run driver=cql tags==phase:schema threads==1 cycles==UNDEF schema: run driver=cql tags==block:schema threads==1 cycles==UNDEF
rampup: run driver=cql tags==phase:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
main: run driver=cql tags==phase:main cycles===TEMPLATE(main-cycles,10000000) threads=auto main: run driver=cql tags==block:"main-*.*" cycles===TEMPLATE(main-cycles,10000000) threads=auto
astra: astra:
schema: run driver=cql tags==phase:schema-astra threads==1 cycles==UNDEF schema: run driver=cql tags==block:schema-astra threads==1 cycles==UNDEF
rampup: run driver=cql tags==phase:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
main: run driver=cql tags==phase:main cycles===TEMPLATE(main-cycles,10000000) threads=auto main: run driver=cql tags==block:"main-*.*" cycles===TEMPLATE(main-cycles,10000000) threads=auto
params: params:
instrument: TEMPLATE(instrument,false) instrument: TEMPLATE(instrument,false)
@ -20,7 +20,7 @@ params:
bindings: bindings:
machine_id: Mod(<<sources:10000>>); ToHashedUUID() -> java.util.UUID machine_id: Mod(<<sources:10000>>); ToHashedUUID() -> java.util.UUID
sensor_name: HashedLineToString('data/variable_words.txt') sensor_name: HashedLineToString('data/variable_words.txt')
time: Mul(<<timespeed:100>>L); Div(<<sources:10000>>L); ToDate() time: Mul(<<timespeed:100>>L); Div(<<sources:10000>>L); ToJavaInstant();
cell_timestamp: Mul(<<timespeed:100>>L); Div(<<sources:10000>>L); Mul(1000L) cell_timestamp: Mul(<<timespeed:100>>L); Div(<<sources:10000>>L); Mul(1000L)
sensor_value: Normal(0.0,5.0); Add(100.0) -> double sensor_value: Normal(0.0,5.0); Add(100.0) -> double
station_id: Div(<<sources:10000>>);Mod(<<stations:100>>); ToHashedUUID() -> java.util.UUID station_id: Div(<<sources:10000>>);Mod(<<stations:100>>); ToHashedUUID() -> java.util.UUID

View File

@ -1,14 +1,22 @@
description: A workload with only text keys and text values description: |
A workload with only text keys and text values.
This workload is rather simple but it is useful for demonstration purposes.
If you want a more thorough example, you might be interested in the
baselinesv2/cql-* workloads.
defaults:
TEMPLATE(keyspace,baselines)
TEMPLATE(table,keyvalue)
scenarios: scenarios:
default: default:
schema: run driver=cql tags==phase:schema threads==1 cycles==UNDEF schema: run driver=cql tags==block:schema threads==1 cycles==UNDEF
rampup: run driver=cql tags==phase:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
main: run driver=cql tags==phase:main cycles===TEMPLATE(main-cycles,10000000) threads=auto main: run driver=cql tags=='block:main-.*' cycles===TEMPLATE(main-cycles,10000000) threads=auto
astra: astra:
schema: run driver=cql tags==phase:schema-astra threads==1 cycles==UNDEF schema: run driver=cql tags==block:schema-astra threads==1 cycles==UNDEF
rampup: run driver=cql tags==phase:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
main: run driver=cql tags==phase:main cycles===TEMPLATE(main-cycles,10000000) threads=auto main: run driver=cql tags=='block:main-.*' cycles===TEMPLATE(main-cycles,10000000) threads=auto
bindings: bindings:
seq_key: Mod(<<keycount:1000000000>>); ToString() -> String seq_key: Mod(<<keycount:1000000000>>); ToString() -> String
@ -17,86 +25,60 @@ bindings:
rw_value: Hash(); <<valdist:Uniform(0,1000000000)->int>>; ToString() -> String rw_value: Hash(); <<valdist:Uniform(0,1000000000)->int>>; ToString() -> String
blocks: blocks:
- name: schema schema:
tags: ops:
phase: schema create-keyspace:
params: raw: |
prepared: false create keyspace if not exists TEMPLATE(keyspace,baselines)
statements: WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 'TEMPLATE(rf,1)>>'}
- create-keyspace: | AND durable_writes = true;
create keyspace if not exists <<keyspace:baselines>> create-table:
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '<<rf:1>>'} raw: |
AND durable_writes = true; create table if not exists TEMPLATE(keyspace,baselines).TEMPLATE(table,keyvalue) (
tags: key text,
name: create-keyspace value text,
- create-table: | PRIMARY KEY (key)
create table if not exists <<keyspace:baselines>>.<<table:keyvalue>> ( );
schema-astra:
ops:
create-table:
raw: |
create table if not exists TEMPLATE(keyspace,baselines).TEMPLATE(table,keyvalue) (
key text, key text,
value text, value text,
PRIMARY KEY (key) PRIMARY KEY (key)
); );
tags: rampup:
name: create-table
- name: schema-astra
tags:
phase: schema-astra
params: params:
prepared: false cl: TEMPLATE(write_cl,LOCAL_QUORUM)
statements: ops:
- create-table: | rampup-insert:
create table if not exists <<keyspace:baselines>>.<<table:keyvalue>> ( prepared: |
key text, insert into TEMPLATE(keyspace,baselines).TEMPLATE(table,keyvalue)
value text,
PRIMARY KEY (key)
);
tags:
name: create-table-astra
- name: rampup
tags:
phase: rampup
params:
cl: <<write_cl:LOCAL_QUORUM>>
statements:
- rampup-insert: |
insert into <<keyspace:baselines>>.<<table:keyvalue>>
(key, value) (key, value)
values ({seq_key},{seq_value}); values ({seq_key},{seq_value});
tags: # verify:
name: rampup-insert # params:
- name: verify # cl: <<read_cl:LOCAL_QUORUM>>
tags: # ops:
phase: verify # verify-select:
type: read # prepared: |
params: # select * from <<keyspace:baselines>>.<<table:keyvalue>> where key={seq_key};
cl: <<read_cl:LOCAL_QUORUM>> # verify-fields: key->seq_key, value->seq_value
statements: main-read:
- verify-select: |
select * from <<keyspace:baselines>>.<<table:keyvalue>> where key={seq_key};
verify-fields: key->seq_key, value->seq_value
tags:
name: verify
- name: main-read
tags:
phase: main
type: read
params: params:
ratio: 5 ratio: 5
cl: <<read_cl:LOCAL_QUORUM>> cl: TEMPLATE(read_cl,LOCAL_QUORUM)
statements: ops:
- main-select: | main-select:
select * from <<keyspace:baselines>>.<<table:keyvalue>> where key={rw_key}; prepared: |
tags: select * from TEMPLATE(keyspace,baselines).TEMPLATE(table,keyvalue) where key={rw_key};
name: main-select main-write:
- name: main-write
tags:
phase: main
type: write
params: params:
ratio: 5 ratio: 5
cl: <<write_cl:LOCAL_QUORUM>> cl: TEMPLATE(write_cl,LOCAL_QUORUM)
statements: ops:
- main-insert: | main-insert:
insert into <<keyspace:baselines>>.<<table:keyvalue>> prepared: |
insert into TEMPLATE(keyspace,baselines).TEMPLATE(table,keyvalue)
(key, value) values ({rw_key}, {rw_value}); (key, value) values ({rw_key}, {rw_value});
tags:
name: main-insert

View File

@ -165,7 +165,11 @@ public class NBCLI implements Function<String[], Integer> {
logger = LogManager.getLogger("NBCLI"); logger = LogManager.getLogger("NBCLI");
loggerConfig.purgeOldFiles(LogManager.getLogger("SCENARIO")); loggerConfig.purgeOldFiles(LogManager.getLogger("SCENARIO"));
logger.info(() -> "Configured scenario log at " + loggerConfig.getLogfileLocation()); if (logger.isInfoEnabled()) {
logger.info(() -> "Configured scenario log at " + loggerConfig.getLogfileLocation());
} else {
System.err.println("Configured scenario log at " + loggerConfig.getLogfileLocation());
}
logger.debug("Scenario log started"); logger.debug("Scenario log started");
// Global only processing // Global only processing