-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtesting.cql
102 lines (87 loc) · 3.19 KB
/
testing.cql
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
CREATE KEYSPACE ceres
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
SELECT *
FROM series_sets;
SELECT metric_name
FROM metric_names
WHERE tenant = 't-1';
SELECT tag_key
FROM tag_keys
WHERE tenant = 't-1'
AND metric_name = 'cpu_idle';
SELECT tag_value
FROM tag_values
WHERE tenant = 't-1'
AND metric_name = 'cpu_idle'
AND tag_key = 'os';
SELECT series_set_hash
FROM series_sets
WHERE tenant = 't-1'
AND metric_name = 'cpu_idle'
AND tag_key = 'os'
AND tag_value = 'linux';
SELECT *
FROM data_raw;
SELECT *
FROM data_raw
WHERE tenant = 't-1'
AND series_set_hash = 'cpu_idle,deployment=dev,host=h-3,os=linux';
// From generated DDL
create table data_raw
(
tenant text,
series_set_hash text,
ts timestamp,
value double,
primary key ((tenant, series_set_hash), ts)
)
with caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
and compaction = {'max_threshold': '32', 'min_threshold': '4', 'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'}
and compression = {'class': 'org.apache.cassandra.io.compress.LZ4Compressor', 'chunk_length_in_kb': '64'}
and dclocal_read_repair_chance = 0.1;
create table metric_names
(
tenant text,
metric_name text,
primary key (tenant, metric_name)
)
with caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
and compaction = {'max_threshold': '32', 'min_threshold': '4', 'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'}
and compression = {'class': 'org.apache.cassandra.io.compress.LZ4Compressor', 'chunk_length_in_kb': '64'}
and dclocal_read_repair_chance = 0.1;
create table series_sets
(
tenant text,
metric_name text,
tag_key text,
tag_value text,
series_set_hash text,
primary key ((tenant, metric_name), tag_key, tag_value, series_set_hash)
)
with caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
and compaction = {'max_threshold': '32', 'min_threshold': '4', 'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'}
and compression = {'class': 'org.apache.cassandra.io.compress.LZ4Compressor', 'chunk_length_in_kb': '64'}
and dclocal_read_repair_chance = 0.1;
create table tag_keys
(
tenant text,
metric_name text,
tag_key text,
primary key ((tenant, metric_name), tag_key)
)
with caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
and compaction = {'max_threshold': '32', 'min_threshold': '4', 'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'}
and compression = {'class': 'org.apache.cassandra.io.compress.LZ4Compressor', 'chunk_length_in_kb': '64'}
and dclocal_read_repair_chance = 0.1;
create table tag_values
(
tenant text,
metric_name text,
tag_key text,
tag_value text,
primary key ((tenant, metric_name), tag_key, tag_value)
)
with caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
and compaction = {'max_threshold': '32', 'min_threshold': '4', 'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'}
and compression = {'class': 'org.apache.cassandra.io.compress.LZ4Compressor', 'chunk_length_in_kb': '64'}
and dclocal_read_repair_chance = 0.1;