-
Notifications
You must be signed in to change notification settings - Fork 68
/
cql_timeseries2.yaml
123 lines (116 loc) · 5.07 KB
/
cql_timeseries2.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: |
This workload emulates a time-series data model and access patterns.
scenarios:
default:
schema: run driver=cql tags==block:schema threads==1 cycles==UNDEF
truncate: run driver=cql tags==block:truncate threads==1 cycles==UNDEF
rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
main: run driver=cql tags==block:"main.*" cycles===TEMPLATE(main-cycles,10000000) threads=auto
astra:
schema: run driver=cql tags==block:schema-astra threads==1 cycles==UNDEF
rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
main: run driver=cql tags==block:"main.*" cycles===TEMPLATE(main-cycles,10000000) threads=auto
basic_check:
schema: run driver=cql tags==block:schema threads==1 cycles==UNDEF
truncate: run driver=cql tags==block:truncate threads==1 cycles==UNDEF
rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,10) threads=auto
main: run driver=cql tags==block:"main.*" cycles===TEMPLATE(main-cycles,10) threads=auto
params:
instrument: TEMPLATE(instrument,false)
bindings:
machine_id: Mod(TEMPLATE(sources,10000)); ToHashedUUID() -> java.util.UUID
sensor_name: HashedLineToString('data/variable_words.txt')
time: Mul(TEMPLATE(timespeed,100)L); Div(TEMPLATE(sources,10000)L); ToJavaInstant()
cell_timestamp: Mul(TEMPLATE(timespeed,100)L); Div(TEMPLATE(sources,10000)L); Mul(1000L)
sensor_value: Normal(0.0,5.0); Add(100.0) -> double
station_id: Div(TEMPLATE(sources,10000));Mod(TEMPLATE(stations,100)); ToHashedUUID() -> java.util.UUID
data: HashedFileExtractToString('data/lorem_ipsum_full.txt',800TEMPLATE(addzeroes,),1200TEMPLATE(addzeroes,))
blocks:
schema:
params:
prepared: false
ops:
create_keyspace: |
create keyspace if not exists TEMPLATE(keyspace,baselines)
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 'TEMPLATE(rf,1)'}
AND durable_writes = true;
create_table: |
create table if not exists TEMPLATE(keyspace,baselines).TEMPLATE(table,iot) (
machine_id UUID, // source machine
sensor_name text, // sensor name
time timestamp, // timestamp of collection
sensor_value double, //
station_id UUID, // source location
data text,
PRIMARY KEY ((machine_id, sensor_name), time)
) WITH CLUSTERING ORDER BY (time DESC)
AND compression = { 'sstable_compression' : 'TEMPLATE(compression,LZ4Compressor)' }
AND compaction = {
'class': 'TimeWindowCompactionStrategy',
'compaction_window_size': TEMPLATE(expiry_minutes,60),
'compaction_window_unit': 'MINUTES'
};
truncate:
params:
prepared: false
ops:
truncate_table: |
truncate table TEMPLATE(keyspace,baselines).TEMPLATE(table,iot);
schema_astra:
params:
prepared: false
ops:
create_table_astra: |
create table if not exists TEMPLATE(keyspace,baselines).TEMPLATE(table,iot) (
machine_id UUID, // source machine
sensor_name text, // sensor name
time timestamp, // timestamp of collection
sensor_value double, //
station_id UUID, // source location
data text,
PRIMARY KEY ((machine_id, sensor_name), time)
) WITH CLUSTERING ORDER BY (time DESC);
rampup:
params:
cl: TEMPLATE(write_cl,LOCAL_QUORUM)
idempotent: true
instrument: TEMPLATE(instrument-writes,TEMPLATE(instrument,false))
ops:
insert_rampup: |
insert into TEMPLATE(keyspace,baselines).TEMPLATE(table,iot)
(machine_id, sensor_name, time, sensor_value, station_id, data)
values ({machine_id}, {sensor_name}, {time}, {sensor_value}, {station_id}, {data})
using timestamp {cell_timestamp}
verify:
params:
ratio: 1
cl: TEMPLATE(read_cl,LOCAL_QUORUM)
instrument: TEMPLATE(instrument-reads,TEMPLATE(instrument,false))
verify-fields: "*, -cell_timestamp"
ops:
select_verify: |
select * from TEMPLATE(keyspace,baselines).TEMPLATE(table,iot)
where machine_id={machine_id} and sensor_name={sensor_name} and time={time};
main_read:
params:
ratio: TEMPLATE(read_ratio,1)
cl: TEMPLATE(read_cl,LOCAL_QUORUM)
instrument: TEMPLATE(instrument-reads,TEMPLATE(instrument,false))
ops:
select_read: |
select * from TEMPLATE(keyspace,baselines).TEMPLATE(table,iot)
where machine_id={machine_id} and sensor_name={sensor_name}
limit TEMPLATE(limit,10);
main_write:
params:
ratio: TEMPLATE(write_ratio,9)
cl: TEMPLATE(write_cl,LOCAL_QUORUM)
instrument: TEMPLATE(instrument-writes,TEMPLATE(instrument,false))
idempotent: true
ops:
insert_main: |
insert into TEMPLATE(keyspace,baselines).TEMPLATE(table,iot)
(machine_id, sensor_name, time, sensor_value, station_id, data)
values ({machine_id}, {sensor_name}, {time}, {sensor_value}, {station_id}, {data})
using timestamp {cell_timestamp};