mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
nb5 revamp for scenarios
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
# Connection Guide: https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/connection/
|
||||
# nb5 run driver=mongodb workload=/path/to/mongodb-keyvalue2.yaml tags=block:schema connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
||||
# nb5 run driver=mongodb workload=/path/to/mongodb-keyvalue2.yaml tags=block:"schema.*" connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
||||
# nb5 run driver=mongodb workload=/path/to/mongodb-keyvalue2.yaml tags=block:rampup cycles=25 connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
||||
# nb5 run driver=mongodb workload=/path/to/mongodb-keyvalue2.yaml tags='block:main-.*' cycles=25 connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
||||
min_version: "4.17.31"
|
||||
min_version: "5.17.1"
|
||||
|
||||
description: |
|
||||
This workload is analogous to the cql-keyvalue2 workload, just implemented for MongoDB.
|
||||
|
||||
scenarios:
|
||||
default:
|
||||
schema: run driver=mongodb tags==block:schema threads==1 cycles==UNDEF
|
||||
schema: run driver=mongodb tags==block:'schema.*' threads==1 cycles==UNDEF
|
||||
rampup: run driver=mongodb tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
|
||||
main: run driver=mongodb tags==block:"main-.*" cycles===TEMPLATE(main-cycles,10000000) threads=auto
|
||||
main: run driver=mongodb tags==block:'main-.*' cycles===TEMPLATE(main-cycles,10000000) threads=auto
|
||||
drop: run driver=mongodb tags==block:drop-collection threads==1 cycles==UNDEF
|
||||
|
||||
params:
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
# Connection Guide: https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/connection/
|
||||
# nb5 run driver=mongodb workload=/path/to/mongodb-tabular2.yaml tags=block:schema connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
||||
# nb5 run driver=mongodb workload=/path/to/mongodb-tabular2.yaml tags=block:"schema.*" connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
||||
# nb5 run driver=mongodb workload=/path/to/mongodb-tabular2.yaml tags=block:rampup cycles=25 connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
||||
# nb5 run driver=mongodb workload=/path/to/mongodb-tabular2.yaml tags='block:main.*' cycles=25 connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
||||
min_version: "4.17.31"
|
||||
min_version: "5.17.1"
|
||||
|
||||
description: |
|
||||
This workload is analogous to the cql-tabular2 workload, just implemented for MongoDB.
|
||||
|
||||
scenarios:
|
||||
default:
|
||||
schema: run driver=mongodb tags==block:schema threads==1 cycles==UNDEF
|
||||
schema: run driver=mongodb tags==block:'schema.*' threads==1 cycles==UNDEF
|
||||
rampup: run driver=mongodb tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
|
||||
main: run driver=mongodb tags==block:"main-.*" cycles===TEMPLATE(main-cycles,10000000) threads=auto
|
||||
main: run driver=mongodb tags==block:'main-.*' cycles===TEMPLATE(main-cycles,10000000) threads=auto
|
||||
drop: run driver=mongodb tags==block:drop-collection threads==1 cycles==UNDEF
|
||||
|
||||
params:
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
# Connection Guide: https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/connection/
|
||||
# nb5 run driver=mongodb workload=/path/to/mongodb-timeseries2.yaml tags=block:schema connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
||||
# nb5 run driver=mongodb workload=/path/to/mongodb-timeseries2.yaml tags=block:"schema.*" connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
||||
# nb5 run driver=mongodb workload=/path/to/mongodb-timeseries2.yaml tags=block:rampup cycles=25 connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
||||
# nb5 run driver=mongodb workload=/path/to/mongodb-timeseries2.yaml tags='block:main.*' cycles=25 connection='mongodb+srv://user:pass@sample-db.host.mongodb.net/?retryWrites=true&w=majority' database=baselines -vv --show-stacktraces
|
||||
|
||||
# https://www.mongodb.com/community/forums/t/how-to-store-a-uuid-with-binary-subtype-0x04-using-the-mongodb-java-driver/13184
|
||||
# https://www.mongodb.com/community/forums/t/problem-inserting-uuid-field-with-binary-subtype-via-atlas-web-ui/1071/4
|
||||
# https://www.mongodb.com/community/forums/t/timeseries-last-x-documents/186574/5
|
||||
min_version: "4.17.31"
|
||||
min_version: "5.17.1"
|
||||
|
||||
description: |
|
||||
This workload is analogous to the cql-timeseries2 workload, just implemented for MongoDB.
|
||||
|
||||
scenarios:
|
||||
default:
|
||||
schema: run driver=mongodb tags==block:schema threads==1 cycles==UNDEF
|
||||
schema: run driver=mongodb tags==block:'schema.*' threads==1 cycles==UNDEF
|
||||
rampup: run driver=mongodb tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
|
||||
main: run driver=mongodb tags==block:"main-.*" cycles===TEMPLATE(main-cycles,10000000) threads=auto
|
||||
main: run driver=mongodb tags==block:'main-.*' cycles===TEMPLATE(main-cycles,10000000) threads=auto
|
||||
drop: run driver=mongodb tags==block:drop-collection threads==1 cycles==UNDEF
|
||||
|
||||
params:
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
# nb -v run driver=mongodb yaml=mongodb-basic-uuid connection=mongodb://127.0.0.1 database=testdb tags=phase:rampup
|
||||
description: An example of a basic mongo insert and find with UUID
|
||||
|
||||
scenarios:
|
||||
default:
|
||||
- run driver=mongodb tags==phase:rampup cycles===TEMPLATE(rampup-cycles,100000000) threads=auto
|
||||
- run driver=mongodb tags==phase:main cycles===TEMPLATE(main-cycles,100000000) threads=auto
|
||||
rampup: run driver=mongodb tags==block:rampup cycles===TEMPLATE(rampup-cycles,100000000) threads=auto
|
||||
main: run driver=mongodb tags==block:main cycles===TEMPLATE(main-cycles,100000000) threads=auto
|
||||
bindings:
|
||||
seq_uuid: Mod(<<uuidCount:100000000>>L); ToHashedUUID() -> java.util.UUID; ToString() -> String
|
||||
rw_uuid: <<uuidDist:Uniform(0,100000000)->long>>; ToHashedUUID() -> java.util.UUID; ToString() -> String
|
||||
@@ -12,69 +11,50 @@ bindings:
|
||||
seq_value: Mod(<<valueCount:1000000000>>L); <<valueSizeDist:Hash()>>; ToLong()
|
||||
rw_key: <<keyDist:Uniform(0,1000000)->long>>; ToInt()
|
||||
rw_value: <<valDist:Uniform(0,1000000000)->long>>; <<valueSizeDist:Hash()>>; ToLong()
|
||||
|
||||
blocks:
|
||||
- name: rampup
|
||||
tags:
|
||||
phase: rampup
|
||||
statements:
|
||||
- rampup-insert: |
|
||||
{
|
||||
insert: "<<collection:keyvalueuuid>>",
|
||||
documents: [ { _id: UUID("{seq_uuid}"),
|
||||
key: {seq_key},
|
||||
value: NumberLong({seq_value}) } ]
|
||||
}
|
||||
params:
|
||||
readPreference: primary
|
||||
tags:
|
||||
name: rampup-insert
|
||||
- name: verify
|
||||
tags:
|
||||
phase: verify
|
||||
type: read
|
||||
params:
|
||||
readPreference: primary
|
||||
rampup:
|
||||
ops:
|
||||
rampup-insert: |
|
||||
{
|
||||
insert: "<<collection:keyvalueuuid>>",
|
||||
documents: [ { _id: UUID("{seq_uuid}"),
|
||||
key: {seq_key},
|
||||
value: NumberLong({seq_value}) } ]
|
||||
}
|
||||
verify:
|
||||
params:
|
||||
cl: <<read_cl:LOCAL_QUORUM>>
|
||||
statements:
|
||||
- verify-find: |
|
||||
{
|
||||
find: "<<collection:keyvalueuuid>>",
|
||||
filter: { _id: UUID("{seq_uuid}") }
|
||||
}
|
||||
verify-fields: _id->seq_uuid, key->seq_key, value->seq_value
|
||||
tags:
|
||||
name: verify
|
||||
- name: main-read
|
||||
tags:
|
||||
phase: main
|
||||
type: read
|
||||
cl: <<read_cl:LOCAL_QUORUM>>
|
||||
verify-fields: _id->seq_uuid, key->seq_key, value->seq_value
|
||||
ops:
|
||||
verify-find: |
|
||||
{
|
||||
find: "<<collection:keyvalueuuid>>",
|
||||
filter: { _id: UUID("{seq_uuid}") }
|
||||
}
|
||||
main-read:
|
||||
params:
|
||||
ratio: <<read_ratio:1>>
|
||||
statements:
|
||||
- main-find: |
|
||||
{
|
||||
find: "<<collection:keyvalueuuid>>",
|
||||
filter: { _id: UUID("{rw_uuid}") }
|
||||
}
|
||||
params:
|
||||
readPreference: primary
|
||||
tags:
|
||||
name: main-find
|
||||
- name: main-write
|
||||
tags:
|
||||
phase: main
|
||||
type: write
|
||||
type: read
|
||||
readPreference: primary
|
||||
ops:
|
||||
main-find: |
|
||||
{
|
||||
find: "<<collection:keyvalueuuid>>",
|
||||
filter: { _id: UUID("{rw_uuid}") }
|
||||
}
|
||||
main-write:
|
||||
params:
|
||||
ratio: <<write_ratio:1>>
|
||||
statements:
|
||||
- main-insert: |
|
||||
{
|
||||
insert: "<<collection:keyvalueuuid>>",
|
||||
documents: [ { _id: UUID("{rw_uuid}")
|
||||
key: {rw_key},
|
||||
value: NumberLong({rw_value}) } ]
|
||||
}
|
||||
params:
|
||||
readPreference: primary
|
||||
tags:
|
||||
name: main-insert
|
||||
type: write
|
||||
readPreference: primary
|
||||
ops:
|
||||
main-insert: |
|
||||
{
|
||||
insert: "<<collection:keyvalueuuid>>",
|
||||
documents: [ { _id: UUID("{rw_uuid}")
|
||||
key: {rw_key},
|
||||
value: NumberLong({rw_value}) } ]
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
# nb -v run driver=mongodb yaml=mongodb-basic connection=mongodb://127.0.0.1 database=testdb tags=phase:rampup cycles=1M
|
||||
description: An example of a basic mongo insert and find.
|
||||
|
||||
scenarios:
|
||||
default:
|
||||
- run driver=mongodb tags==phase:rampup cycles===TEMPLATE(rampup-cycles,1000000) threads=auto
|
||||
- run driver=mongodb tags==phase:main cycles===TEMPLATE(main-cycles,1000000) threads=auto
|
||||
rampup: run driver=mongodb tags==block:rampup cycles===TEMPLATE(rampup-cycles,1000000) threads=auto
|
||||
main: run driver=mongodb tags==block:'main-*.*' cycles===TEMPLATE(main-cycles,10000000) threads=auto
|
||||
|
||||
bindings:
|
||||
seq_key: Mod(<<keyCount:1000000>>L); ToInt()
|
||||
seq_value: Mod(<<valueCount:1000000000>>L); <<valueSizeDist:Hash()>>; ToString() -> String
|
||||
@@ -12,46 +12,39 @@ bindings:
|
||||
rw_value: <<valDist:Uniform(0,1000000000)->int>>; <<valueSizeDist:Hash()>>; ToString() -> String
|
||||
|
||||
blocks:
|
||||
- name: rampup
|
||||
tags:
|
||||
phase: rampup
|
||||
statements:
|
||||
- rampup-insert: |
|
||||
rampup:
|
||||
ops:
|
||||
rampup-insert: |
|
||||
{
|
||||
insert: "<<collection:keyvalue>>",
|
||||
documents: [ { _id: {seq_key},
|
||||
value: {seq_value} } ]
|
||||
documents: [ { _id: {seq_key}, value: {seq_value} } ]
|
||||
}
|
||||
params:
|
||||
readPreference: primary
|
||||
tags:
|
||||
name: rampup-insert
|
||||
- name: main-read
|
||||
tags:
|
||||
phase: main
|
||||
type: read
|
||||
|
||||
main-read:
|
||||
params:
|
||||
ratio: <<read_ratio:1>>
|
||||
statements:
|
||||
- main-find: |
|
||||
{
|
||||
find: "<<collection:keyvalue>>",
|
||||
filter: { _id: {rw_key} }
|
||||
}
|
||||
params:
|
||||
readPreference: primary
|
||||
- name: main-write
|
||||
tags:
|
||||
phase: main
|
||||
type: write
|
||||
readPreference: primary
|
||||
type: read
|
||||
ops:
|
||||
main-find: |
|
||||
{
|
||||
find: "<<collection:keyvalue>>",
|
||||
filter: { _id: {rw_key} }
|
||||
}
|
||||
|
||||
main-write:
|
||||
params:
|
||||
ratio: <<write_ratio:1>>
|
||||
statements:
|
||||
- main-insert: |
|
||||
type: write
|
||||
ops:
|
||||
main-insert: |
|
||||
{
|
||||
insert: "<<collection:keyvalue>>",
|
||||
documents: [ { _id: {rw_key},
|
||||
value: {rw_value} } ]
|
||||
documents: [ { _id: {rw_key}, value: {rw_value} } ]
|
||||
}
|
||||
params:
|
||||
readPreference: primary
|
||||
readPreference: primary
|
||||
@@ -1,4 +1,3 @@
|
||||
# nb -v run driver=mongodb yaml=mongodb-crud-basic tags=phase:schema connection=mongodb://127.0.0.1 database=testdb
|
||||
|
||||
description: |
|
||||
This workload emulates CRUD operations for the mongoDB.
|
||||
@@ -7,11 +6,11 @@ description: |
|
||||
|
||||
scenarios:
|
||||
default:
|
||||
schema: run driver=mongodb tags==phase:schema threads==1 cycles==UNDEF
|
||||
write: run driver=mongodb tags==phase:main,type:write cycles===TEMPLATE(write-cycles,TEMPLATE(docscount,10000000)) threads=auto errors=timer,warn
|
||||
read: run driver=mongodb tags==phase:main,type:read cycles===TEMPLATE(read-cycles,TEMPLATE(docscount,10000000)) threads=auto errors=timer,warn
|
||||
update: run driver=mongodb tags==phase:main,type:update cycles===TEMPLATE(update-cycles,TEMPLATE(docscount,10000000)) threads=auto errors=timer,warn
|
||||
delete: run driver=mongodb tags==phase:main,type:delete cycles===TEMPLATE(delete-cycles,TEMPLATE(docscount,10000000)) threads=auto errors=timer,warn
|
||||
schema: run driver=mongodb tags==block:'schema.*' threads==1 cycles==UNDEF
|
||||
write: run driver=mongodb tags==block:main-write,type:write cycles===TEMPLATE(write-cycles,TEMPLATE(docscount,10000000)) threads=auto errors=timer,warn
|
||||
read: run driver=mongodb tags==block:main-read,type:read cycles===TEMPLATE(read-cycles,TEMPLATE(docscount,10000000)) threads=auto errors=timer,warn
|
||||
update: run driver=mongodb tags==block:main-update,type:update cycles===TEMPLATE(update-cycles,TEMPLATE(docscount,10000000)) threads=auto errors=timer,warn
|
||||
delete: run driver=mongodb tags==block:main-delete,type:delete cycles===TEMPLATE(delete-cycles,TEMPLATE(docscount,10000000)) threads=auto errors=timer,warn
|
||||
|
||||
bindings:
|
||||
seq_key: Mod(<<docscount:10000000>>); ToString() -> String
|
||||
@@ -29,62 +28,93 @@ bindings:
|
||||
friend_id: Add(-1); ToHashedUUID(); ToString() -> String
|
||||
|
||||
blocks:
|
||||
- tags:
|
||||
phase: schema
|
||||
statements:
|
||||
- dummy-insert: |
|
||||
{
|
||||
insert: "<<collection:crud_basic>>",
|
||||
documents: [ { _id: "dummyyyy" } ]
|
||||
}
|
||||
schema:
|
||||
ops:
|
||||
dummy-insert: |
|
||||
{
|
||||
insert: "<<collection:crud_basic>>",
|
||||
documents: [ { _id: "dummyyyy" } ]
|
||||
}
|
||||
drop-collection: |
|
||||
{
|
||||
drop: "<<collection:crud_basic>>"
|
||||
}
|
||||
create-collection: |
|
||||
{
|
||||
create: "<<collection:crud_basic>>"
|
||||
}
|
||||
create-indexes: |
|
||||
{
|
||||
createIndexes: "<<collection:crud_basic>>",
|
||||
indexes: [
|
||||
{
|
||||
key: { user_id: 1 },
|
||||
name: "user_id_idx",
|
||||
unique: true
|
||||
},
|
||||
{
|
||||
key: { created_on: 1 },
|
||||
name: "created_on_idx"
|
||||
},
|
||||
{
|
||||
key: { gender: 1 },
|
||||
name: "gender_idx"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
- drop-collection: |
|
||||
{
|
||||
drop: "<<collection:crud_basic>>"
|
||||
}
|
||||
tags:
|
||||
name: drop-collection
|
||||
|
||||
- create-collection: |
|
||||
{
|
||||
create: "<<collection:crud_basic>>"
|
||||
}
|
||||
tags:
|
||||
name: create-collection
|
||||
|
||||
- create-indexes: |
|
||||
{
|
||||
createIndexes: "<<collection:crud_basic>>",
|
||||
indexes: [
|
||||
{
|
||||
key: { user_id: 1 },
|
||||
name: "user_id_idx",
|
||||
unique: true
|
||||
main-write:
|
||||
ops:
|
||||
write-document: |
|
||||
{
|
||||
insert: "<<collection:crud_basic>>",
|
||||
writeConcern: { w: "majority" },
|
||||
documents: [
|
||||
{
|
||||
"_id": "{seq_key}",
|
||||
"user_id": "{user_id}",
|
||||
"created_on": {created_on},
|
||||
"gender": "{gender}",
|
||||
"full_name": "{full_name}",
|
||||
"married": {married},
|
||||
"address": {
|
||||
"primary": {
|
||||
"city": "{city}",
|
||||
"cc": "{country_code}"
|
||||
},
|
||||
"secondary": {}
|
||||
},
|
||||
{
|
||||
key: { created_on: 1 },
|
||||
name: "created_on_idx"
|
||||
},
|
||||
{
|
||||
key: { gender: 1 },
|
||||
name: "gender_idx"
|
||||
}
|
||||
]
|
||||
}
|
||||
tags:
|
||||
name: create-indexes
|
||||
"coordinates": [
|
||||
{lat},
|
||||
{lng}
|
||||
],
|
||||
"children": [],
|
||||
"friends": [
|
||||
"{friend_id}"
|
||||
],
|
||||
"debt": null
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
- name: main-write
|
||||
tags:
|
||||
phase: main
|
||||
type: write
|
||||
statements:
|
||||
- write-document: |
|
||||
{
|
||||
insert: "<<collection:crud_basic>>",
|
||||
writeConcern: { w: "majority" },
|
||||
documents: [
|
||||
{
|
||||
main-read:
|
||||
ops:
|
||||
read-document: |
|
||||
{
|
||||
find: "<<collection:crud_basic>>",
|
||||
filter: { _id: "{random_key}" }
|
||||
}
|
||||
|
||||
main-update:
|
||||
ops:
|
||||
update-document: |
|
||||
{
|
||||
update: "<<collection:crud_basic>>",
|
||||
writeConcern: { w: "majority" },
|
||||
updates: [
|
||||
{
|
||||
q: { _id: "{random_key}" },
|
||||
u: {
|
||||
"_id": "{seq_key}",
|
||||
"user_id": "{user_id}",
|
||||
"created_on": {created_on},
|
||||
@@ -108,78 +138,19 @@ blocks:
|
||||
],
|
||||
"debt": null
|
||||
}
|
||||
]
|
||||
}
|
||||
tags:
|
||||
name: write-document
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
- name: main-read
|
||||
tags:
|
||||
phase: main
|
||||
type: read
|
||||
statements:
|
||||
- read-document: |
|
||||
{
|
||||
find: "<<collection:crud_basic>>",
|
||||
filter: { _id: "{random_key}" }
|
||||
}
|
||||
tags:
|
||||
name: read-document
|
||||
|
||||
- name: main-update
|
||||
tags:
|
||||
phase: main
|
||||
type: update
|
||||
statements:
|
||||
- update-document: |
|
||||
{
|
||||
update: "<<collection:crud_basic>>",
|
||||
writeConcern: { w: "majority" },
|
||||
updates: [
|
||||
{
|
||||
q: { _id: "{random_key}" },
|
||||
u: {
|
||||
"_id": "{seq_key}",
|
||||
"user_id": "{user_id}",
|
||||
"created_on": {created_on},
|
||||
"gender": "{gender}",
|
||||
"full_name": "{full_name}",
|
||||
"married": {married},
|
||||
"address": {
|
||||
"primary": {
|
||||
"city": "{city}",
|
||||
"cc": "{country_code}"
|
||||
},
|
||||
"secondary": {}
|
||||
},
|
||||
"coordinates": [
|
||||
{lat},
|
||||
{lng}
|
||||
],
|
||||
"children": [],
|
||||
"friends": [
|
||||
"{friend_id}"
|
||||
],
|
||||
"debt": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
tags:
|
||||
name: update-document
|
||||
|
||||
- name: main-delete
|
||||
tags:
|
||||
phase: main
|
||||
type: delete
|
||||
statements:
|
||||
- delete-document: |
|
||||
{
|
||||
delete: "<<collection:crud_basic>>",
|
||||
deletes: [
|
||||
{
|
||||
q: { _id: "{seq_key}" },
|
||||
limit: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
main-delete:
|
||||
ops:
|
||||
delete-document: |
|
||||
{
|
||||
delete: "<<collection:crud_basic>>",
|
||||
deletes: [
|
||||
{
|
||||
q: { _id: "{seq_key}" },
|
||||
limit: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
# nb -v run driver=mongodb yaml=mongodb-crud-dataset tags=phase:schema connection=mongodb://127.0.0.1 database=testdb dataset_file=path/to/data.json
|
||||
|
||||
description: |
|
||||
This workload emulates CRUD operations for the mongoDB.
|
||||
@@ -7,110 +6,85 @@ description: |
|
||||
|
||||
scenarios:
|
||||
default:
|
||||
schema: run driver=mongodb tags==phase:schema threads==1 cycles==UNDEF
|
||||
write: run driver=mongodb tags==phase:main,type:write cycles===TEMPLATE(write-cycles,TEMPLATE(docscount,10000000)) threads=auto errors=timer,warn
|
||||
read: run driver=mongodb tags==phase:main,type:read cycles===TEMPLATE(read-cycles,TEMPLATE(docscount,10000000)) threads=auto errors=timer,warn
|
||||
update: run driver=mongodb tags==phase:main,type:update cycles===TEMPLATE(update-cycles,TEMPLATE(docscount,10000000)) threads=auto errors=timer,warn
|
||||
delete: run driver=mongodb tags==phase:main,type:delete cycles===TEMPLATE(delete-cycles,TEMPLATE(docscount,10000000)) threads=auto errors=timer,warn
|
||||
schema: run driver=mongodb tags==block:'schema.*' threads==1 cycles==UNDEF
|
||||
write: run driver=mongodb tags==block:main-write,type:write cycles===TEMPLATE(write-cycles,TEMPLATE(docscount,10000000)) threads=auto errors=timer,warn
|
||||
read: run driver=mongodb tags==block:main-read,type:read cycles===TEMPLATE(read-cycles,TEMPLATE(docscount,10000000)) threads=auto errors=timer,warn
|
||||
update: run driver=mongodb tags==block:main-update,type:update cycles===TEMPLATE(update-cycles,TEMPLATE(docscount,10000000)) threads=auto errors=timer,warn
|
||||
delete: run driver=mongodb tags==block:main-delete,type:delete cycles===TEMPLATE(delete-cycles,TEMPLATE(docscount,10000000)) threads=auto errors=timer,warn
|
||||
|
||||
bindings:
|
||||
seq_key: Mod(<<docscount:10000000>>); ToString() -> String
|
||||
random_key: Uniform(0,<<docscount:10000000>>); ToString() -> String
|
||||
|
||||
blocks:
|
||||
- tags:
|
||||
phase: schema
|
||||
statements:
|
||||
- dummy-insert: |
|
||||
{
|
||||
insert: "<<collection:crud_dataset>>",
|
||||
documents: [ { _id: "dummyyyy" } ]
|
||||
}
|
||||
schema:
|
||||
ops:
|
||||
dummy-insert: |
|
||||
{
|
||||
insert: "<<collection:crud_dataset>>",
|
||||
documents: [ { _id: "dummyyyy" } ]
|
||||
}
|
||||
|
||||
- drop-collection: |
|
||||
{
|
||||
drop: "<<collection:crud_dataset>>"
|
||||
}
|
||||
tags:
|
||||
name: drop-collection
|
||||
drop-collection: |
|
||||
{
|
||||
drop: "<<collection:crud_dataset>>"
|
||||
}
|
||||
|
||||
- create-collection: |
|
||||
{
|
||||
create: "<<collection:crud_dataset>>"
|
||||
}
|
||||
tags:
|
||||
name: create-collection
|
||||
create-collection: |
|
||||
{
|
||||
create: "<<collection:crud_dataset>>"
|
||||
}
|
||||
|
||||
- create-indexes: |
|
||||
{
|
||||
createIndexes: "<<collection:crud_dataset>>",
|
||||
indexes: <<indexes:[ { key: { dummy : 1 }, name: "dummy_idx", sparse: true } ]>>
|
||||
}
|
||||
tags:
|
||||
name: create-indexes
|
||||
create-indexes: |
|
||||
{
|
||||
createIndexes: "<<collection:crud_dataset>>",
|
||||
indexes: <<indexes:[ { key: { dummy : 1 }, name: "dummy_idx", sparse: true } ]>>
|
||||
}
|
||||
|
||||
- name: main-write
|
||||
tags:
|
||||
phase: main
|
||||
type: write
|
||||
statements:
|
||||
- write-document: |
|
||||
{
|
||||
insert: "<<collection:crud_dataset>>",
|
||||
writeConcern: { w: "majority" },
|
||||
documents: [ { "_id": "{seq_key}", {document_json_without_id} ]
|
||||
}
|
||||
tags:
|
||||
name: write-document
|
||||
main-write:
|
||||
ops:
|
||||
write-document: |
|
||||
{
|
||||
insert: "<<collection:crud_dataset>>",
|
||||
writeConcern: { w: "majority" },
|
||||
documents: [ { "_id": "{seq_key}", {document_json_without_id} ]
|
||||
}
|
||||
bindings:
|
||||
document_json_without_id: ModuloLineToString('<<dataset_file>>'); ReplaceRegex('^\{', '')
|
||||
|
||||
- name: main-read
|
||||
tags:
|
||||
phase: main
|
||||
type: read
|
||||
statements:
|
||||
- read-document: |
|
||||
{
|
||||
find: "<<collection:crud_dataset>>",
|
||||
filter: { _id: "{random_key}" }
|
||||
}
|
||||
tags:
|
||||
name: read-document
|
||||
main-read:
|
||||
ops:
|
||||
read-document: |
|
||||
{
|
||||
find: "<<collection:crud_dataset>>",
|
||||
filter: { _id: "{random_key}" }
|
||||
}
|
||||
|
||||
- name: main-update
|
||||
tags:
|
||||
phase: main
|
||||
type: update
|
||||
statements:
|
||||
- update-document: |
|
||||
{
|
||||
update: "<<collection:crud_dataset>>",
|
||||
writeConcern: { w: "majority" },
|
||||
updates: [
|
||||
{
|
||||
q: { _id: "{random_key}" },
|
||||
u: { "_id": "{random_key}", {document_json_without_id}
|
||||
}
|
||||
]
|
||||
}
|
||||
tags:
|
||||
name: update-document
|
||||
main-update:
|
||||
ops:
|
||||
update-document: |
|
||||
{
|
||||
update: "<<collection:crud_dataset>>",
|
||||
writeConcern: { w: "majority" },
|
||||
updates: [
|
||||
{
|
||||
q: { _id: "{random_key}" },
|
||||
u: { "_id": "{random_key}", {document_json_without_id}
|
||||
}
|
||||
]
|
||||
}
|
||||
bindings:
|
||||
document_json_without_id: ModuloLineToString('<<dataset_file>>'); ReplaceRegex('^\{', '')
|
||||
|
||||
- name: main-delete
|
||||
tags:
|
||||
phase: main
|
||||
type: delete
|
||||
statements:
|
||||
- delete-document: |
|
||||
{
|
||||
delete: "<<collection:crud_dataset>>",
|
||||
deletes: [
|
||||
{
|
||||
q: { _id: "{seq_key}" },
|
||||
limit: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
main-delete:
|
||||
ops:
|
||||
delete-document: |
|
||||
{
|
||||
delete: "<<collection:crud_dataset>>",
|
||||
deletes: [
|
||||
{
|
||||
q: { _id: "{seq_key}" },
|
||||
limit: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
# nb -v run driver=mongodb yaml=mongodb-search-basic tags=phase:schema connection=mongodb://127.0.0.1 database=testdb
|
||||
|
||||
description: |
|
||||
This workload emulates basic search operations for the mongoDB.
|
||||
@@ -7,15 +6,15 @@ description: |
|
||||
It's a counterpart of the Stargate's Documents API Basic Search workflow.
|
||||
|
||||
scenarios:
|
||||
schema: run driver=mongodb tags==phase:schema threads==1 cycles==UNDEF
|
||||
rampup-write: run driver=mongodb tags==phase:rampup-write cycles===TEMPLATE(docscount,10000000) docpadding=TEMPLATE(docpadding,0) match-ratio=TEMPLATE(match-ratio,0.01) threads=auto errors=timer,warn
|
||||
rampup-read: run driver=mongodb tags==phase:rampup-read cycles===TEMPLATE(rampup-cycles, 10000000) field-projection=TEMPLATE(fields,null) threads=<<threads:auto>> errors=timer,warn
|
||||
main: run driver=mongodb tags==phase:main cycles===TEMPLATE(read-cycles,TEMPLATE(docscount,10000000)) field-projection=TEMPLATE(fields,null) threads=<<threads:auto>> errors=timer,warn
|
||||
main-eq: run driver=mongodb tags==phase:main,filter:eq cycles===TEMPLATE(read-cycles,TEMPLATE(docscount,10000000)) field-projection=TEMPLATE(fields,null) threads=<<threads:auto>> errors=timer,warn
|
||||
main-lt: run driver=mongodb tags==phase:main,filter:lt cycles===TEMPLATE(read-cycles,TEMPLATE(docscount,10000000)) field-projection=TEMPLATE(fields,null) threads=<<threads:auto>> errors=timer,warn
|
||||
main-and: run driver=mongodb tags==phase:main,filter:and cycles===TEMPLATE(read-cycles,TEMPLATE(docscount,10000000)) field-projection=TEMPLATE(fields,null) threads=<<threads:auto>> errors=timer,warn
|
||||
main-or: run driver=mongodb tags==phase:main,filter:or cycles===TEMPLATE(read-cycles,TEMPLATE(docscount,10000000)) field-projection=TEMPLATE(fields,null) threads=<<threads:auto>> errors=timer,warn
|
||||
main-or-single-match: run driver=mongodb tags==phase:main,filter:or-single-match cycles===TEMPLATE(read-cycles,TEMPLATE(docscount,10000000)) field-projection=TEMPLATE(fields,null) threads=<<threads:auto>> errors=timer,warn
|
||||
schema: run driver=mongodb tags==block:'schema.*' threads==1 cycles==UNDEF
|
||||
rampup-write: run driver=mongodb tags==block:rampup-write cycles===TEMPLATE(docscount,10000000) docpadding=TEMPLATE(docpadding,0) match-ratio=TEMPLATE(match-ratio,0.01) threads=auto errors=timer,warn
|
||||
rampup-read: run driver=mongodb tags==block:rampup-read cycles===TEMPLATE(rampup-cycles, 10000000) field-projection=TEMPLATE(fields,null) threads=<<threads:auto>> errors=timer,warn
|
||||
main: run driver=mongodb tags==block:main cycles===TEMPLATE(read-cycles,TEMPLATE(docscount,10000000)) field-projection=TEMPLATE(fields,null) threads=<<threads:auto>> errors=timer,warn
|
||||
main-eq: run driver=mongodb tags==block:main-eq,filter:eq cycles===TEMPLATE(read-cycles,TEMPLATE(docscount,10000000)) field-projection=TEMPLATE(fields,null) threads=<<threads:auto>> errors=timer,warn
|
||||
main-lt: run driver=mongodb tags==block:main-lt,filter:lt cycles===TEMPLATE(read-cycles,TEMPLATE(docscount,10000000)) field-projection=TEMPLATE(fields,null) threads=<<threads:auto>> errors=timer,warn
|
||||
main-and: run driver=mongodb tags==block:main-and,filter:and cycles===TEMPLATE(read-cycles,TEMPLATE(docscount,10000000)) field-projection=TEMPLATE(fields,null) threads=<<threads:auto>> errors=timer,warn
|
||||
main-or: run driver=mongodb tags==block:main-or,filter:or cycles===TEMPLATE(read-cycles,TEMPLATE(docscount,10000000)) field-projection=TEMPLATE(fields,null) threads=<<threads:auto>> errors=timer,warn
|
||||
main-or-single-match: run driver=mongodb tags==block:main-or-single-match,filter:or-single-match cycles===TEMPLATE(read-cycles,TEMPLATE(docscount,10000000)) field-projection=TEMPLATE(fields,null) threads=<<threads:auto>> errors=timer,warn
|
||||
|
||||
bindings:
|
||||
seq_key: Mod(<<docscount:10000000>>); ToString() -> String
|
||||
@@ -34,57 +33,49 @@ bindings:
|
||||
match1: Identity(); CoinFunc(<<match-ratio>>, FixedValue(0), FixedValue(1000))
|
||||
match2: Identity(); CoinFunc(<<match-ratio>>, FixedValue("true"), FixedValue("false"))
|
||||
additional_fields: ListSizedStepped(<<docpadding:0>>,Template("\"{}\":{}",Identity(),Identity())); ToString(); ReplaceAll('\[\"', ',\"'); ReplaceAll('\[', ''); ReplaceAll('\]', '') -> String
|
||||
|
||||
blocks:
|
||||
- tags:
|
||||
phase: schema
|
||||
statements:
|
||||
- dummy-insert: |
|
||||
{
|
||||
insert: "<<collection:search_basic>>",
|
||||
documents: [ { _id: "dummyyyy" } ]
|
||||
}
|
||||
schema:
|
||||
ops:
|
||||
dummy-insert: |
|
||||
{
|
||||
insert: "<<collection:search_basic>>",
|
||||
documents: [ { _id: "dummyyyy" } ]
|
||||
}
|
||||
|
||||
- drop-collection: |
|
||||
{
|
||||
drop: "<<collection:search_basic>>"
|
||||
}
|
||||
tags:
|
||||
name: drop-collection
|
||||
drop-collection: |
|
||||
{
|
||||
drop: "<<collection:search_basic>>"
|
||||
}
|
||||
|
||||
- create-collection: |
|
||||
{
|
||||
create: "<<collection:search_basic>>"
|
||||
}
|
||||
tags:
|
||||
name: create-collection
|
||||
create-collection: |
|
||||
{
|
||||
create: "<<collection:search_basic>>"
|
||||
}
|
||||
|
||||
- create-indexes: |
|
||||
{
|
||||
createIndexes: "<<collection:search_basic>>",
|
||||
indexes: [
|
||||
{
|
||||
key: { user_id: 1 },
|
||||
name: "user_id_idx",
|
||||
unique: true
|
||||
},
|
||||
{
|
||||
key: { created_on: 1 },
|
||||
name: "created_on_idx"
|
||||
},
|
||||
{
|
||||
key: { city: 1 },
|
||||
name: "city_idx"
|
||||
}
|
||||
]
|
||||
}
|
||||
tags:
|
||||
name: create-indexes
|
||||
create-indexes: |
|
||||
{
|
||||
createIndexes: "<<collection:search_basic>>",
|
||||
indexes: [
|
||||
{
|
||||
key: { user_id: 1 },
|
||||
name: "user_id_idx",
|
||||
unique: true
|
||||
},
|
||||
{
|
||||
key: { created_on: 1 },
|
||||
name: "created_on_idx"
|
||||
},
|
||||
{
|
||||
key: { city: 1 },
|
||||
name: "city_idx"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
- name: rampup-write
|
||||
tags:
|
||||
phase: rampup-write
|
||||
statements:
|
||||
- write-document: |
|
||||
rampup-write:
|
||||
ops:
|
||||
write-document:
|
||||
{
|
||||
insert: "<<collection:search_basic>>",
|
||||
writeConcern: { w: "majority" },
|
||||
@@ -118,83 +109,62 @@ blocks:
|
||||
}
|
||||
]
|
||||
}
|
||||
tags:
|
||||
name: rampup-write
|
||||
|
||||
- name: rampup
|
||||
tags:
|
||||
phase: rampup-read
|
||||
filter: eq
|
||||
statements:
|
||||
- read-document: |
|
||||
rampup-read:
|
||||
params:
|
||||
filter: eq
|
||||
ops:
|
||||
read-document: |
|
||||
{
|
||||
find: "<<collection:search_basic>>",
|
||||
filter: { match1: 0 }
|
||||
}, <<field-projection:null>>
|
||||
tags:
|
||||
name: rampup-read
|
||||
|
||||
- name: main-eq
|
||||
tags:
|
||||
phase: main
|
||||
main-eq:
|
||||
params:
|
||||
filter: eq
|
||||
statements:
|
||||
- read-document: |
|
||||
ops:
|
||||
read-document: |
|
||||
{
|
||||
find: "<<collection:search_basic>>",
|
||||
filter: { match3: true }
|
||||
}, <<field-projection:null>>
|
||||
tags:
|
||||
name: read-document
|
||||
}, <<field-projection:null>>
|
||||
|
||||
- name: main-lt
|
||||
tags:
|
||||
phase: main
|
||||
main-lt:
|
||||
params:
|
||||
filter: lt
|
||||
statements:
|
||||
- read-document: |
|
||||
ops:
|
||||
read-document: |
|
||||
{
|
||||
find: "<<collection:search_basic>>",
|
||||
filter: { match1: {$lt: 1}}
|
||||
}, <<field-projection:null>>
|
||||
tags:
|
||||
name: read-document
|
||||
}, <<field-projection:null>>
|
||||
|
||||
- name: main-and
|
||||
tags:
|
||||
phase: main
|
||||
main-and:
|
||||
params:
|
||||
filter: and
|
||||
statements:
|
||||
- read-document: |
|
||||
{
|
||||
find: "<<collection:search_basic>>",
|
||||
filter: { match1: {$lt: 1}, match2: "true"}
|
||||
}, <<field-projection:null>>
|
||||
tags:
|
||||
name: read-document
|
||||
ops:
|
||||
read-document: |
|
||||
{
|
||||
find: "<<collection:search_basic>>",
|
||||
filter: { match1: {$lt: 1}, match2: "true"}
|
||||
}, <<field-projection:null>>
|
||||
|
||||
- name: main-or
|
||||
tags:
|
||||
phase: main
|
||||
main-or:
|
||||
params:
|
||||
filter: or
|
||||
statements:
|
||||
- read-document: |
|
||||
ops:
|
||||
read-document: |
|
||||
{
|
||||
find: "<<collection:search_basic>>",
|
||||
filter: { $or: [ {match1: {$lt: 1}}, {match3: true}]}
|
||||
}, <<field-projection:null>>
|
||||
tags:
|
||||
name: read-document
|
||||
}, <<field-projection:null>>
|
||||
|
||||
- name: main-or-single-match
|
||||
tags:
|
||||
phase: main
|
||||
main-or-single-match:
|
||||
params:
|
||||
filter: or-single-match
|
||||
statements:
|
||||
- read-document: |
|
||||
{
|
||||
find: "<<collection:search_basic>>",
|
||||
filter: { $or: [ {match1: {$lt: 1}}, {match2: "notamatch"}]}
|
||||
}, <<field-projection:null>>
|
||||
tags:
|
||||
name: read-document
|
||||
ops:
|
||||
read-document: |
|
||||
{
|
||||
find: "<<collection:search_basic>>",
|
||||
filter: { $or: [ {match1: {$lt: 1}}, {match2: "notamatch"}]}
|
||||
}, <<field-projection:null>>
|
||||
Reference in New Issue
Block a user