|
376 | 376 | sed -n "s/^report-threshold\t/$test_name\t/p" < "$test_file" >> "analyze/report-thresholds.tsv" |
377 | 377 | sed -n "s/^skipped\t/$test_name\t/p" < "$test_file" >> "analyze/skipped-tests.tsv" |
378 | 378 | sed -n "s/^display-name\t/$test_name\t/p" < "$test_file" >> "analyze/query-display-names.tsv" |
379 | | - sed -n "s/^short\t/$test_name\t/p" < "$test_file" >> "analyze/marked-short-queries.tsv" |
380 | 379 | sed -n "s/^partial\t/$test_name\t/p" < "$test_file" >> "analyze/partial-queries.tsv" |
381 | 380 | done |
382 | 381 |
|
@@ -817,23 +816,18 @@ create view query_runs as select * from file('analyze/query-runs.tsv', TSV, |
817 | 816 | -- calculate and check the average query run time in the report. |
818 | 817 | -- We have to be careful, because we will encounter: |
819 | 818 | -- 1) partial queries which run only on one server |
820 | | --- 2) short queries which run for a much higher number of times |
821 | 819 | -- 3) some errors that make query run for a different number of times on a |
822 | 820 | -- particular server. |
823 | 821 | -- |
824 | 822 | create view test_runs as |
825 | 823 | select test, |
826 | 824 | -- Default to 7 runs if there are only 'short' queries in the test, and |
827 | 825 | -- we can't determine the number of runs. |
828 | | - if((ceil(medianOrDefaultIf(t.runs, not short), 0) as r) != 0, r, 7) runs |
| 826 | + if((ceil(median(t.runs), 0) as r) != 0, r, 7) runs |
829 | 827 | from ( |
830 | 828 | select |
831 | 829 | -- The query id is the same for both servers, so no need to divide here. |
832 | 830 | uniqExact(query_id) runs, |
833 | | - (test, query_index) in |
834 | | - (select * from file('analyze/marked-short-queries.tsv', TSV, |
835 | | - 'test text, query_index int')) |
836 | | - as short, |
837 | 831 | test, query_index |
838 | 832 | from query_runs |
839 | 833 | group by test, query_index |
@@ -918,41 +912,6 @@ create table all_tests_report engine File(TSV, 'report/all-queries.tsv') |
918 | 912 | from queries order by test, query_index; |
919 | 913 |
|
920 | 914 |
|
921 | | --- Report of queries that have inconsistent 'short' markings: |
922 | | --- 1) have short duration, but are not marked as 'short' |
923 | | --- 2) the reverse -- marked 'short' but take too long. |
924 | | --- The threshold for 2) is significantly larger than the threshold for 1), to |
925 | | --- avoid jitter. |
926 | | -create view shortness |
927 | | - as select |
928 | | - (test, query_index) in |
929 | | - (select * from file('analyze/marked-short-queries.tsv', TSV, |
930 | | - 'test text, query_index int')) |
931 | | - as marked_short, |
932 | | - time, test, query_index, query_display_name |
933 | | - from ( |
934 | | - select right time, test, query_index from queries |
935 | | - union all |
936 | | - select time_median, test, query_index from partial_query_times |
937 | | - ) times |
938 | | - left join query_display_names |
939 | | - on times.test = query_display_names.test |
940 | | - and times.query_index = query_display_names.query_index |
941 | | - ; |
942 | | -
|
943 | | -create table inconsistent_short_marking_report |
944 | | - engine File(TSV, 'report/unexpected-query-duration.tsv') |
945 | | - as select |
946 | | - multiIf(marked_short and time > 0.1, '\"short\" queries must run faster than 0.02 s', |
947 | | - not marked_short and time < 0.02, '\"normal\" queries must run longer than 0.1 s', |
948 | | - '') problem, |
949 | | - marked_short, time, |
950 | | - test, query_index, query_display_name |
951 | | - from shortness |
952 | | - where problem != '' |
953 | | - ; |
954 | | -
|
955 | | -
|
956 | 915 | -------------------------------------------------------------------------------- |
957 | 916 | -- various compatibility data formats follow, not related to the main report |
958 | 917 |
|
@@ -1432,4 +1391,3 @@ esac |
1432 | 1391 | # Print some final debug info to help debug Weirdness, of which there is plenty. |
1433 | 1392 | jobs |
1434 | 1393 | pstree -apgT |
1435 | | - |
0 commit comments