You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[--ms milliseconds] how many milliseconds to test for
21
21
[--workload /path/to/workload.json] probability table spec
22
22
[--query CYPHER_QUERY] single cypher query to run
23
+
[--schema /path/to/schema.json] schema for generated records (only used with
24
+
--query)
25
+
[--batchsize [1000]] number of records from schema to generate per batch
23
26
[--concurrency c] how many concurrent queries to run (default: 10)
24
27
[--checkpoint cn] how often to print results in milliseconds (default: 5000)
25
28
[--fail-fast] if specified, the work will stop after encountering one
@@ -35,6 +38,9 @@ Options:
35
38
-a address to connect to [default: "localhost"]
36
39
-u username [default: "neo4j"]
37
40
-p password [required]
41
+
-d database
42
+
--schema batch schema file
43
+
--batchsize number of records per batch, usable only with schema
38
44
-n number of hits on the database
39
45
--ms number of milliseconds to execute
40
46
--workload absolute path to JSON probability table/workload
@@ -69,12 +75,28 @@ program arguments, as in, `npm run graph-workload -- --n 20`
69
75
70
76
# Examples
71
77
72
-
Create a lot of nodes as fast as possible:
78
+
## Create a lot of nodes as fast as possible:
73
79
74
80
```
75
81
npm run graph-workload -- -a localhost -u neo4j -p admin --query 'Unwind range(1,1000000) as id create (n);' -n 50 --concurrency 4
76
82
```
77
83
84
+
## Write custom data generated in batches
85
+
86
+
Fake/mock data can be generated with functions from [fakerjs](https://www.npmjs.com/package/faker).
87
+
88
+
Using this technique you can generate your own data and create
89
+
custom load patterns. Similar to other Neo4j utilities, the batch will be present in the query form: "UNWIND batch AS event".
90
+
91
+
```
92
+
npm run graph-workload -- -a localhost -u neo4j -p admin \
93
+
--query 'CREATE (t:Test) SET t += event' \
94
+
--batchsize 1000 \
95
+
--schema /absolute/path/to/schemas/myschema.json
96
+
```
97
+
98
+
See `src/schemas/user.json` as an example of a schema you can use in this way. Keys are field names to generate, values are the faker functions used to populate that field.
99
+
78
100
# Neo4j 4.0 / Multidatabase
79
101
80
102
As of Neo4j 4.0, sessions support multi-database. Use the `-d` or `--database` argument to direct
0 commit comments