-
Notifications
You must be signed in to change notification settings - Fork 68
/
graph_wheels.yaml
124 lines (117 loc) · 4.16 KB
/
graph_wheels.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
min_version: "5.17.1"
description: creates local graphs which resemble a wagon-wheel topology, using
DSE Graph, version 6.8 or newer
scenarios:
default:
creategraph: run driver=cqld4 graphname=graph_wheels tags=block:create-graph cycles===UNDEF
schema: run driver=cqld4 graphname=graph_wheels tags=block:graph-schema cycles===UNDEF
rampup: run driver==cqld4 graphname=graph_wheels tags=block:rampup cycles=1
drop_graph: run driver=cqld4 graphname=graph_wheels tags=block:drop-graph cycles===UNDEF
creategraph_classic: run driver=cqld4 graphname=graph_wheels tags=block:create_graph_classic cycles===UNDEF
fluent: run driver=cqld4 graphname=graph_wheels tags=block:fluent cycles=10
devmode: run driver=cqld4 graphname=graph_wheels tags=name:dev-mode
prodmode: run driver=cqld4 graphname=graph_wheels tags=name:prod-mode
bindings:
sessionid: ToEpochTimeUUID()->java.util.UUID; ToString();
deviceid: Add(200000); Div(<<sessons_per_device:10>>); ToEpochTimeUUID()->java.util.UUID; ToString();
type: WeightedStrings('phone:10;computer:10;')
os: WeightedStrings('android:6;ios:4;linux:2;osx:7;windows:3')
osversion: WeightedStrings('nougat:3;oreo:1;jellybean:2;4:1;4c:1;5:1;5c:1;trusty:1;xenial:1;yosemite:1;el capitan:2;sierra:3;high sierra:1;7:1;10:2')
ipaddress: Combinations('1;7;0-3;.;0-2;0-2;0-5;.;0-2;0-2;0-5')
createdtime: Add(1505256898)
diag_ten_pct: WeightedLongs('1:1;0:9')
diag_one_pct: WeightedLongs('1:1;0:99')
blocks:
drop_graph:
statements:
drop_graph:
type: gremlin
script: "system.graph('<<graphname:graph_wheels>>').ifExists().drop();"
create_graph_classic:
statements:
creategraph:
type: gremlin
script: >-
system.graph('<<graphname:graph_wheels>>')
.classicEngine()
.create()
create_graph:
statements:
creategraph:
type: gremlin
script: >-
system.graph('<<graphname:graph_wheels>>').ifNotExists().create()
create_schema:
statements:
graph_schema:
type: gremlin
graphname: <<graphname:graph_wheels>>
script: >-
schema.vertexLabel('session')
.ifNotExists()
.partitionBy('sessionid', Uuid)
.property('ipaddress', Text)
.property('deviceid', Uuid)
.property('createdtime', Bigint)
.create();
schema.vertexLabel('device')
.ifNotExists()
.partitionBy('deviceid', Uuid)
.property('type', Text)
.property('os', Text)
.property('osversion', Text)
.create();
schema.edgeLabel('using')
.ifNotExists()
.from('session')
.to('device')
.create()
dev_mode:
tags:
block: dev-mode
statements:
dev_mode:
type: gremlin
graphname: <<graphname:graph_wheels>>
script: >-
schema.config().option('graph.schema_mode').set('Development');
prod_mode:
tags:
block: prod-mode
statements:
prod_mode:
type: gremlin
graphname: <<graphname:graph_wheels>>
script: >-
schema.config().option('graph.schema_mode').set('Production');
rampup:
tags:
block: rampup
statements:
main_add:
type: gremlin
diag: "{diag_one_pct}"
graphname: <<graphname:graph_wheels>>
script: >-
device = g.addV('device')
.property('deviceid', '{deviceid}' as UUID)
.property('type', '{type}')
.property('os', '{os}')
.property('osversion', '{osversion}')
.as('d')
.addV('session')
.property('sessionid', '{sessionid}' as UUID)
.property('ipaddress', '{ipaddress}')
.property('deviceid', '{deviceid}' as UUID)
.property('createdtime', {createdtime})
.as('s')
.addE('using').from('s').to('d');
fluent:
statements:
read:
type: fluent
graphname: <<graphname:graph_wheels>>
imports:
- "org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__"
fluent: >-
g.V().hasLabel("device").has("deviceid", UUID.fromString({deviceid}))