Merge pull request #10262 from ClickHouse/add-graphite-test

Add graphite test
This commit is contained in:
Nikolai Kochetov 2020-04-14 23:01:50 +03:00 committed by GitHub
commit 4110130e23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 399 additions and 0 deletions

View File

@ -70,6 +70,7 @@ CMD dpkg -i package_folder/clickhouse-common-static_*.deb; \
ln -s /usr/share/clickhouse-test/config/disks.xml /etc/clickhouse-server/config.d/; \
ln -s /usr/share/clickhouse-test/config/secure_ports.xml /etc/clickhouse-server/config.d/; \
ln -s /usr/share/clickhouse-test/config/clusters.xml /etc/clickhouse-server/config.d/; \
ln -s /usr/share/clickhouse-test/config/graphite.xml /etc/clickhouse-server/config.d/; \
ln -s /usr/share/clickhouse-test/config/server.key /etc/clickhouse-server/; \
ln -s /usr/share/clickhouse-test/config/server.crt /etc/clickhouse-server/; \
ln -s /usr/share/clickhouse-test/config/dhparam.pem /etc/clickhouse-server/; \

28
tests/config/graphite.xml Normal file
View File

@ -0,0 +1,28 @@
<yandex>
<graphite_rollup>
<version_column_name>Version</version_column_name>
<pattern>
<regexp>sum</regexp>
<function>sum</function>
<retention>
<age>0</age>
<precision>600</precision>
</retention>
<retention>
<age>172800</age> <!-- 2 days -->
<precision>6000</precision>
</retention>
</pattern>
<default>
<function>max</function>
<retention>
<age>0</age>
<precision>600</precision>
</retention>
<retention>
<age>172800</age>
<precision>6000</precision>
</retention>
</default>
</graphite_rollup>
</yandex>

View File

@ -0,0 +1,344 @@
1 max_1 9 1 0
1 max_1 19 1 10
1 max_1 29 1 20
1 max_1 39 1 30
1 max_1 49 1 40
1 max_1 59 1 50
1 max_1 69 1 60
1 max_1 79 1 70
1 max_1 89 1 80
1 max_1 99 1 90
1 max_1 109 1 100
1 max_1 119 1 110
1 max_1 129 1 120
1 max_1 139 1 130
1 max_1 149 1 140
1 max_1 159 1 150
1 max_1 169 1 160
1 max_1 179 1 170
1 max_1 189 1 180
1 max_1 199 1 190
1 max_1 209 1 200
1 max_1 219 1 210
1 max_1 229 1 220
1 max_1 239 1 230
1 max_1 249 1 240
1 max_1 259 1 250
1 max_1 269 1 260
1 max_1 279 1 270
1 max_1 289 1 280
1 max_1 299 1 290
1 max_1 39 1 0
1 max_1 139 1 40
1 max_1 239 1 140
1 max_1 339 1 240
1 max_1 439 1 340
1 max_1 539 1 440
1 max_1 639 1 540
1 max_1 739 1 640
1 max_1 839 1 740
1 max_1 939 1 840
1 max_1 1039 1 940
1 max_1 1139 1 1040
1 max_1 1199 1 1140
1 max_2 9 1 0
1 max_2 19 1 10
1 max_2 29 1 20
1 max_2 39 1 30
1 max_2 49 1 40
1 max_2 59 1 50
1 max_2 69 1 60
1 max_2 79 1 70
1 max_2 89 1 80
1 max_2 99 1 90
1 max_2 109 1 100
1 max_2 119 1 110
1 max_2 129 1 120
1 max_2 139 1 130
1 max_2 149 1 140
1 max_2 159 1 150
1 max_2 169 1 160
1 max_2 179 1 170
1 max_2 189 1 180
1 max_2 199 1 190
1 max_2 209 1 200
1 max_2 219 1 210
1 max_2 229 1 220
1 max_2 239 1 230
1 max_2 249 1 240
1 max_2 259 1 250
1 max_2 269 1 260
1 max_2 279 1 270
1 max_2 289 1 280
1 max_2 299 1 290
1 max_2 39 1 0
1 max_2 139 1 40
1 max_2 239 1 140
1 max_2 339 1 240
1 max_2 439 1 340
1 max_2 539 1 440
1 max_2 639 1 540
1 max_2 739 1 640
1 max_2 839 1 740
1 max_2 939 1 840
1 max_2 1039 1 940
1 max_2 1139 1 1040
1 max_2 1199 1 1140
1 sum_1 45 1 0
1 sum_1 145 1 10
1 sum_1 245 1 20
1 sum_1 345 1 30
1 sum_1 445 1 40
1 sum_1 545 1 50
1 sum_1 645 1 60
1 sum_1 745 1 70
1 sum_1 845 1 80
1 sum_1 945 1 90
1 sum_1 1045 1 100
1 sum_1 1145 1 110
1 sum_1 1245 1 120
1 sum_1 1345 1 130
1 sum_1 1445 1 140
1 sum_1 1545 1 150
1 sum_1 1645 1 160
1 sum_1 1745 1 170
1 sum_1 1845 1 180
1 sum_1 1945 1 190
1 sum_1 2045 1 200
1 sum_1 2145 1 210
1 sum_1 2245 1 220
1 sum_1 2345 1 230
1 sum_1 2445 1 240
1 sum_1 2545 1 250
1 sum_1 2645 1 260
1 sum_1 2745 1 270
1 sum_1 2845 1 280
1 sum_1 2945 1 290
1 sum_1 780 1 0
1 sum_1 8950 1 40
1 sum_1 18950 1 140
1 sum_1 28950 1 240
1 sum_1 38950 1 340
1 sum_1 48950 1 440
1 sum_1 58950 1 540
1 sum_1 68950 1 640
1 sum_1 78950 1 740
1 sum_1 88950 1 840
1 sum_1 98950 1 940
1 sum_1 108950 1 1040
1 sum_1 70170 1 1140
1 sum_2 45 1 0
1 sum_2 145 1 10
1 sum_2 245 1 20
1 sum_2 345 1 30
1 sum_2 445 1 40
1 sum_2 545 1 50
1 sum_2 645 1 60
1 sum_2 745 1 70
1 sum_2 845 1 80
1 sum_2 945 1 90
1 sum_2 1045 1 100
1 sum_2 1145 1 110
1 sum_2 1245 1 120
1 sum_2 1345 1 130
1 sum_2 1445 1 140
1 sum_2 1545 1 150
1 sum_2 1645 1 160
1 sum_2 1745 1 170
1 sum_2 1845 1 180
1 sum_2 1945 1 190
1 sum_2 2045 1 200
1 sum_2 2145 1 210
1 sum_2 2245 1 220
1 sum_2 2345 1 230
1 sum_2 2445 1 240
1 sum_2 2545 1 250
1 sum_2 2645 1 260
1 sum_2 2745 1 270
1 sum_2 2845 1 280
1 sum_2 2945 1 290
1 sum_2 780 1 0
1 sum_2 8950 1 40
1 sum_2 18950 1 140
1 sum_2 28950 1 240
1 sum_2 38950 1 340
1 sum_2 48950 1 440
1 sum_2 58950 1 540
1 sum_2 68950 1 640
1 sum_2 78950 1 740
1 sum_2 88950 1 840
1 sum_2 98950 1 940
1 sum_2 108950 1 1040
1 sum_2 70170 1 1140
2 max_1 9 1 0
2 max_1 19 1 10
2 max_1 29 1 20
2 max_1 39 1 30
2 max_1 49 1 40
2 max_1 59 1 50
2 max_1 69 1 60
2 max_1 79 1 70
2 max_1 89 1 80
2 max_1 99 1 90
2 max_1 109 1 100
2 max_1 119 1 110
2 max_1 129 1 120
2 max_1 139 1 130
2 max_1 149 1 140
2 max_1 159 1 150
2 max_1 169 1 160
2 max_1 179 1 170
2 max_1 189 1 180
2 max_1 199 1 190
2 max_1 209 1 200
2 max_1 219 1 210
2 max_1 229 1 220
2 max_1 239 1 230
2 max_1 249 1 240
2 max_1 259 1 250
2 max_1 269 1 260
2 max_1 279 1 270
2 max_1 289 1 280
2 max_1 299 1 290
2 max_1 39 1 0
2 max_1 139 1 40
2 max_1 239 1 140
2 max_1 339 1 240
2 max_1 439 1 340
2 max_1 539 1 440
2 max_1 639 1 540
2 max_1 739 1 640
2 max_1 839 1 740
2 max_1 939 1 840
2 max_1 1039 1 940
2 max_1 1139 1 1040
2 max_1 1199 1 1140
2 max_2 9 1 0
2 max_2 19 1 10
2 max_2 29 1 20
2 max_2 39 1 30
2 max_2 49 1 40
2 max_2 59 1 50
2 max_2 69 1 60
2 max_2 79 1 70
2 max_2 89 1 80
2 max_2 99 1 90
2 max_2 109 1 100
2 max_2 119 1 110
2 max_2 129 1 120
2 max_2 139 1 130
2 max_2 149 1 140
2 max_2 159 1 150
2 max_2 169 1 160
2 max_2 179 1 170
2 max_2 189 1 180
2 max_2 199 1 190
2 max_2 209 1 200
2 max_2 219 1 210
2 max_2 229 1 220
2 max_2 239 1 230
2 max_2 249 1 240
2 max_2 259 1 250
2 max_2 269 1 260
2 max_2 279 1 270
2 max_2 289 1 280
2 max_2 299 1 290
2 max_2 39 1 0
2 max_2 139 1 40
2 max_2 239 1 140
2 max_2 339 1 240
2 max_2 439 1 340
2 max_2 539 1 440
2 max_2 639 1 540
2 max_2 739 1 640
2 max_2 839 1 740
2 max_2 939 1 840
2 max_2 1039 1 940
2 max_2 1139 1 1040
2 max_2 1199 1 1140
2 sum_1 45 1 0
2 sum_1 145 1 10
2 sum_1 245 1 20
2 sum_1 345 1 30
2 sum_1 445 1 40
2 sum_1 545 1 50
2 sum_1 645 1 60
2 sum_1 745 1 70
2 sum_1 845 1 80
2 sum_1 945 1 90
2 sum_1 1045 1 100
2 sum_1 1145 1 110
2 sum_1 1245 1 120
2 sum_1 1345 1 130
2 sum_1 1445 1 140
2 sum_1 1545 1 150
2 sum_1 1645 1 160
2 sum_1 1745 1 170
2 sum_1 1845 1 180
2 sum_1 1945 1 190
2 sum_1 2045 1 200
2 sum_1 2145 1 210
2 sum_1 2245 1 220
2 sum_1 2345 1 230
2 sum_1 2445 1 240
2 sum_1 2545 1 250
2 sum_1 2645 1 260
2 sum_1 2745 1 270
2 sum_1 2845 1 280
2 sum_1 2945 1 290
2 sum_1 780 1 0
2 sum_1 8950 1 40
2 sum_1 18950 1 140
2 sum_1 28950 1 240
2 sum_1 38950 1 340
2 sum_1 48950 1 440
2 sum_1 58950 1 540
2 sum_1 68950 1 640
2 sum_1 78950 1 740
2 sum_1 88950 1 840
2 sum_1 98950 1 940
2 sum_1 108950 1 1040
2 sum_1 70170 1 1140
2 sum_2 45 1 0
2 sum_2 145 1 10
2 sum_2 245 1 20
2 sum_2 345 1 30
2 sum_2 445 1 40
2 sum_2 545 1 50
2 sum_2 645 1 60
2 sum_2 745 1 70
2 sum_2 845 1 80
2 sum_2 945 1 90
2 sum_2 1045 1 100
2 sum_2 1145 1 110
2 sum_2 1245 1 120
2 sum_2 1345 1 130
2 sum_2 1445 1 140
2 sum_2 1545 1 150
2 sum_2 1645 1 160
2 sum_2 1745 1 170
2 sum_2 1845 1 180
2 sum_2 1945 1 190
2 sum_2 2045 1 200
2 sum_2 2145 1 210
2 sum_2 2245 1 220
2 sum_2 2345 1 230
2 sum_2 2445 1 240
2 sum_2 2545 1 250
2 sum_2 2645 1 260
2 sum_2 2745 1 270
2 sum_2 2845 1 280
2 sum_2 2945 1 290
2 sum_2 780 1 0
2 sum_2 8950 1 40
2 sum_2 18950 1 140
2 sum_2 28950 1 240
2 sum_2 38950 1 340
2 sum_2 48950 1 440
2 sum_2 58950 1 540
2 sum_2 68950 1 640
2 sum_2 78950 1 740
2 sum_2 88950 1 840
2 sum_2 98950 1 940
2 sum_2 108950 1 1040
2 sum_2 70170 1 1140

View File

@ -0,0 +1,26 @@
drop table if exists test_graphite;
create table test_graphite (key UInt32, Path String, Time DateTime, Value Float64, Version UInt32, col UInt64) engine = GraphiteMergeTree('graphite_rollup') order by key settings index_granularity=10;
insert into test_graphite
select 1, 'sum_1', toDateTime(today()) - number * 60 - 30, number, 1, number from numbers(300) union all
select 2, 'sum_1', toDateTime(today()) - number * 60 - 30, number, 1, number from numbers(300) union all
select 1, 'sum_2', toDateTime(today()) - number * 60 - 30, number, 1, number from numbers(300) union all
select 2, 'sum_2', toDateTime(today()) - number * 60 - 30, number, 1, number from numbers(300) union all
select 1, 'max_1', toDateTime(today()) - number * 60 - 30, number, 1, number from numbers(300) union all
select 2, 'max_1', toDateTime(today()) - number * 60 - 30, number, 1, number from numbers(300) union all
select 1, 'max_2', toDateTime(today()) - number * 60 - 30, number, 1, number from numbers(300) union all
select 2, 'max_2', toDateTime(today()) - number * 60 - 30, number, 1, number from numbers(300);
insert into test_graphite
select 1, 'sum_1', toDateTime(today() - 3) - number * 60 - 30, number, 1, number from numbers(1200) union all
select 2, 'sum_1', toDateTime(today() - 3) - number * 60 - 30, number, 1, number from numbers(1200) union all
select 1, 'sum_2', toDateTime(today() - 3) - number * 60 - 30, number, 1, number from numbers(1200) union all
select 2, 'sum_2', toDateTime(today() - 3) - number * 60 - 30, number, 1, number from numbers(1200) union all
select 1, 'max_1', toDateTime(today() - 3) - number * 60 - 30, number, 1, number from numbers(1200) union all
select 2, 'max_1', toDateTime(today() - 3) - number * 60 - 30, number, 1, number from numbers(1200) union all
select 1, 'max_2', toDateTime(today() - 3) - number * 60 - 30, number, 1, number from numbers(1200) union all
select 2, 'max_2', toDateTime(today() - 3) - number * 60 - 30, number, 1, number from numbers(1200);
optimize table test_graphite;
select key, Path, Value, Version, col from test_graphite order by key, Path, Time desc;