This is an automated email from the ASF dual-hosted git repository. mblow pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/asterixdb.git
commit 604c303c08f9e45ce8c0a091aca95f91b187b416 Author: Ian Maxon <[email protected]> AuthorDate: Thu Aug 31 13:35:18 2023 -0700 [ASTERIXDB-3100][TEST]Add sleep-based tests for profiler - user model changes: no - storage format changes: no - interface changes: no Details: - Add tests using sleep() to check the correctness of the profiler in simple queries Change-Id: Ie477ba08405d2e58cb4b27d5d160e7773fc12469 Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17755 Integration-Tests: Jenkins <[email protected]> Tested-by: Jenkins <[email protected]> Reviewed-by: Ian Maxon <[email protected]> Reviewed-by: Ali Alsuliman <[email protected]> --- .../src/test/resources/runtimets/profiled.xml | 6 + .../queries_sqlpp/profile/sleep/sleep.1.ddl.sqlpp | 62 +++++++ .../profile/sleep/sleep.2.update.sqlpp | 32 ++++ .../profile/sleep/sleep.3.profile.sqlpp | 23 +++ .../profile/sleep/sleep.4.profile.sqlpp | 26 +++ .../profile/sleep/sleep.5.profile.sqlpp | 27 +++ .../queries_sqlpp/profile/sleep/sleep.90.ddl.sqlpp | 20 +++ .../results/profile/sleep/sleep.3.regexjson | 57 +++++++ .../results/profile/sleep/sleep.4.regexjson | 130 +++++++++++++++ .../results/profile/sleep/sleep.5.regexjson | 181 +++++++++++++++++++++ 10 files changed, 564 insertions(+) diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/profiled.xml b/asterixdb/asterix-app/src/test/resources/runtimets/profiled.xml index f3209a1ea1..a404639539 100644 --- a/asterixdb/asterix-app/src/test/resources/runtimets/profiled.xml +++ b/asterixdb/asterix-app/src/test/resources/runtimets/profiled.xml @@ -38,5 +38,11 @@ <output-dir compare="Text">full-scan-3</output-dir> </compilation-unit> </test-case> + <test-case FilePath="profile"> + <compilation-unit name="sleep"> + <parameter name="profile" value="timings" type="string"/> + <output-dir compare="Text">sleep</output-dir> + </compilation-unit> + </test-case> </test-group> </test-suite> \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/profile/sleep/sleep.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/profile/sleep/sleep.1.ddl.sqlpp new file mode 100644 index 0000000000..aedce7b327 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/profile/sleep/sleep.1.ddl.sqlpp @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +/* + * Description : Testing that "off" is supplied in request parameter "profile". + * Expected Res : Success with expected result not having "profile" field. + */ + +drop dataverse test if exists; +create dataverse test; + +use test; + +create type test.AddressType as +{ + number : bigint, + street : string, + city : string +}; + +create type test.CustomerType as + closed { + cid : bigint, + name : string, + age : bigint?, + address : AddressType?, + lastorder : { + oid : bigint, + total : float + } +}; + +create type test.OrderType as +{ + oid : bigint, + cid : bigint, + orderstatus : string, + orderpriority : string, + clerk : string, + total : float +}; + +create dataset Customers(CustomerType) primary key cid; + +create dataset Orders(OrderType) primary key oid; + +create dataset Customers2(CustomerType) primary key cid; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/profile/sleep/sleep.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/profile/sleep/sleep.2.update.sqlpp new file mode 100644 index 0000000000..07af22ec33 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/profile/sleep/sleep.2.update.sqlpp @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +use test; + +load dataset Customers using localfs + ((`path`=`asterix_nc1://data/custord-tiny/customer-tiny-neg.adm`), + (`format`=`adm`)); + +load dataset Orders using localfs + ((`path`=`asterix_nc1://data/custord-tiny/order-tiny.adm`), + (`format`=`adm`)); + +load dataset Customers2 using localfs + ((`path`=`asterix_nc1://data/custord-tiny/customer-tiny.adm`), + (`format`=`adm`)); diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/profile/sleep/sleep.3.profile.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/profile/sleep/sleep.3.profile.sqlpp new file mode 100644 index 0000000000..43f8e4a644 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/profile/sleep/sleep.3.profile.sqlpp @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +-- compareunorderedarray=true +use test; + +select sleep(c.cid,500) from Customers c; \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/profile/sleep/sleep.4.profile.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/profile/sleep/sleep.4.profile.sqlpp new file mode 100644 index 0000000000..ea35b8982d --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/profile/sleep/sleep.4.profile.sqlpp @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +-- compareunorderedarray=true +USE test; + +SELECT count(*) AS customers, city +FROM Customers c +WHERE c.age < 65 +GROUP BY sleep(c.address.city, 1000) AS city; \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/profile/sleep/sleep.5.profile.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/profile/sleep/sleep.5.profile.sqlpp new file mode 100644 index 0000000000..1358a62144 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/profile/sleep/sleep.5.profile.sqlpp @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +-- compareunorderedarray=true +USE test; + +SELECT count(*) AS customers, city +FROM Customers c +WHERE c.age <65 +GROUP BY c.address.city +ORDER BY sleep(city,1666); \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/profile/sleep/sleep.90.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/profile/sleep/sleep.90.ddl.sqlpp new file mode 100644 index 0000000000..f12a2b7f77 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/profile/sleep/sleep.90.ddl.sqlpp @@ -0,0 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +drop dataverse test; \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/profile/sleep/sleep.3.regexjson b/asterixdb/asterix-app/src/test/resources/runtimets/results/profile/sleep/sleep.3.regexjson new file mode 100644 index 0000000000..bfb8c62f07 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/profile/sleep/sleep.3.regexjson @@ -0,0 +1,57 @@ +{ + "job-id": "R{[A-Z0-9.:]+}", + "create-time": "R{[0-9.]+}", + "start-time": "R{[0-9.]+}", + "queued-time": "R{.+}", + "end-time": "R{[0-9.]+}", + "counters": [], + "joblets": [ + { + "node-id": "R{.+}", + "counters": [], + "tasks": [ + { + "activity-id": "R{[A-Z0-9.:]+}", + "partition": "R{[0-9]+}", + "attempt": "R{[0-9]+}", + "partition-send-profile": [], + "counters": [ + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}" + }, + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}", + "pages-read": "R{[0-9.]+}", + "pages-read-cold": "R{[0-9.]+}", + "cardinality-out": "R{[0-9.]+}", + "avg-tuple-size": "R{[0-9.]+}", + "min-tuple-size": "R{[0-9.]+}", + "max-tuple-size": "R{[0-9.]+}" + }, + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}", + "cardinality-out": "R{[0-9.]+}", + "avg-tuple-size": "R{[0-9.]+}", + "min-tuple-size": "R{[0-9.]+}", + "max-tuple-size": "R{[0-9.]+}" + }, + { + "name": "R{.+}", + "run-time": "R{5.+}", + "runtime-id": "R{.+}", + "cardinality-out": 10, + "avg-tuple-size": 25, + "min-tuple-size": 25, + "max-tuple-size": 25 + } + ] + } + ] + }] +} \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/profile/sleep/sleep.4.regexjson b/asterixdb/asterix-app/src/test/resources/runtimets/results/profile/sleep/sleep.4.regexjson new file mode 100644 index 0000000000..012133ee2e --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/profile/sleep/sleep.4.regexjson @@ -0,0 +1,130 @@ +{ + "job-id": "R{[A-Z0-9.:]+}", + "create-time": "R{[0-9.]+}", + "start-time": "R{[0-9.]+}", + "queued-time": "R{.+}", + "end-time": "R{[0-9.]+}", + "counters": [], + "joblets": [ + { + "node-id": "R{.+}", + "counters": [], + "tasks": [ + { + "activity-id": "R{[A-Z0-9.:]+}", + "partition": "R{[0-9]+}", + "attempt": "R{[0-9]+}", + "partition-send-profile": [ + { + "partition-id": { + "job-id": "R{[A-Z0-9.:]+}", + "connector-id": "R{[A-Z0-9.:]+}", + "sender-index": "R{[0-9]+}", + "receiver-index": "R{[0-9]+}" + }, + "open-time": "R{[0-9]+}", + "close-time": "R{[0-9]+}", + "offset": "R{[0-9]+}", + "frame-times": [ + 0 + ], + "resolution": 1 + } + ], + "counters": [ + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}" + } + ] + }, + { + "activity-id": "R{[A-Z0-9.:]+}", + "partition": "R{[0-9]+}", + "attempt": "R{[0-9]+}", + "partition-send-profile": [], + "counters": [ + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}" + } + ] + }, + { + "activity-id": "R{[A-Z0-9.:]+}", + "partition": "R{[0-9]+}", + "attempt": "R{[0-9]+}", + "partition-send-profile": [], + "counters": [ + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}", + "cardinality-out": "R{[0-9.]+}", + "avg-tuple-size": "R{[0-9.]+}", + "min-tuple-size": "R{[0-9.]+}", + "max-tuple-size": "R{[0-9.]+}" + }, + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}", + "cardinality-out": "R{[0-9.]+}", + "avg-tuple-size": "R{[0-9.]+}", + "min-tuple-size": "R{[0-9.]+}", + "max-tuple-size": "R{[0-9.]+}" + }, + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}" + } + ] + }, + { + "activity-id": "R{[A-Z0-9.:]+}", + "partition": "R{[0-9]+}", + "attempt": "R{[0-9]+}", + "partition-send-profile": [], + "counters": [ + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}", + "cardinality-out": "R{[0-9.]+}", + "avg-tuple-size": "R{[0-9.]+}", + "min-tuple-size": "R{[0-9.]+}", + "max-tuple-size": "R{[0-9.]+}" + }, + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}", + "pages-read": "R{[0-9.]+}", + "pages-read-cold": "R{[0-9.]+}", + "cardinality-out": "R{[0-9.]+}", + "avg-tuple-size": "R{[0-9.]+}", + "min-tuple-size": "R{[0-9.]+}", + "max-tuple-size": "R{[0-9.]+}" + }, + { + "name": "R{.+}", + "run-time": "R{5.+}", + "runtime-id": "R{.+}", + "cardinality-out": "R{[0-9.]+}", + "avg-tuple-size": "R{[0-9.]+}", + "min-tuple-size": "R{[0-9.]+}", + "max-tuple-size": "R{[0-9.]+}" + }, + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}" + } + ] + } + ] + }] +} diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/profile/sleep/sleep.5.regexjson b/asterixdb/asterix-app/src/test/resources/runtimets/results/profile/sleep/sleep.5.regexjson new file mode 100644 index 0000000000..b024312fd7 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/profile/sleep/sleep.5.regexjson @@ -0,0 +1,181 @@ +{ + "job-id": "R{[A-Z0-9.:]+}", + "create-time": "R{[0-9.]+}", + "start-time": "R{[0-9.]+}", + "queued-time": "R{.+}", + "end-time": "R{[0-9.]+}", + "counters": [], + "joblets": [ + { + "node-id": "R{.+}", + "counters": [], + "tasks": [ + { + "activity-id": "R{[A-Z0-9.:]+}", + "partition": "R{[0-9]+}", + "attempt": "R{[0-9]+}", + "partition-send-profile": [ + { + "partition-id": { + "job-id": "R{[A-Z0-9.:]+}", + "connector-id": "R{[A-Z0-9.:]+}", + "sender-index": "R{[0-9]+}", + "receiver-index": "R{[0-9]+}" + }, + "open-time": "R{[0-9]+}", + "close-time": "R{[0-9]+}", + "offset": "R{[0-9]+}", + "frame-times": [ + 0 + ], + "resolution": 1 + } + ], + "counters": [ + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}" + } + ] + }, + { + "activity-id": "R{[A-Z0-9.:]+}", + "partition": "R{[0-9]+}", + "attempt": "R{[0-9]+}", + "partition-send-profile": [], + "counters": [ + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}" + } + ] + }, + { + "activity-id": "R{[A-Z0-9.:]+}", + "partition": "R{[0-9]+}", + "attempt": "R{[0-9]+}", + "partition-send-profile": [], + "counters": [ + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}", + "cardinality-out": "R{[0-9.]+}", + "avg-tuple-size": "R{[0-9.]+}", + "min-tuple-size": "R{[0-9.]+}", + "max-tuple-size": "R{[0-9.]+}" + }, + { + "name": "R{.+}", + "run-time": "R{5.+}", + "runtime-id": "R{.+}", + "cardinality-out": "R{[0-9.]+}", + "avg-tuple-size": "R{[0-9.]+}", + "min-tuple-size": "R{[0-9.]+}", + "max-tuple-size": "R{[0-9.]+}" + }, + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}" + } + ] + }, + { + "activity-id": "R{[A-Z0-9.:]+}", + "partition": "R{[0-9]+}", + "attempt": "R{[0-9]+}", + "partition-send-profile": [ + { + "partition-id": { + "job-id": "R{[A-Z0-9.:]+}", + "connector-id": "R{[A-Z0-9.:]+}", + "sender-index": "R{[0-9]+}", + "receiver-index": "R{[0-9]+}" + }, + "open-time": "R{[0-9]+}", + "close-time": "R{[0-9]+}", + "offset": "R{[0-9]+}", + "frame-times": [ + 0 + ], + "resolution": 1 + } + ], + "counters": [ + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}" + } + ] + }, + { + "activity-id": "R{[A-Z0-9.:]+}", + "partition": "R{[0-9]+}", + "attempt": "R{[0-9]+}", + "partition-send-profile": [], + "counters": [ + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}", + "cardinality-out": "R{[0-9.]+}", + "avg-tuple-size": "R{[0-9.]+}", + "min-tuple-size": "R{[0-9.]+}", + "max-tuple-size": "R{[0-9.]+}" + }, + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}" + } + ] + }, + { + "activity-id": "R{[A-Z0-9.:]+}", + "partition": "R{[0-9]+}", + "attempt": "R{[0-9]+}", + "partition-send-profile": [], + "counters": [ + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}", + "cardinality-out": "R{[0-9.]+}", + "avg-tuple-size": "R{[0-9.]+}", + "min-tuple-size": "R{[0-9.]+}", + "max-tuple-size": "R{[0-9.]+}" + }, + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}", + "pages-read": "R{[0-9.]+}", + "pages-read-cold": "R{[0-9.]+}", + "cardinality-out": "R{[0-9.]+}", + "avg-tuple-size": "R{[0-9.]+}", + "min-tuple-size": "R{[0-9.]+}", + "max-tuple-size": "R{[0-9.]+}" + }, + { + "name": "R{.+}", + "run-time": "R{[0-9].+}", + "runtime-id": "R{.+}", + "cardinality-out": "R{[0-9.]+}", + "avg-tuple-size": "R{[0-9.]+}", + "min-tuple-size": "R{[0-9.]+}", + "max-tuple-size": "R{[0-9.]+}" + }, + { + "name": "R{.+}", + "run-time": "R{[0-9.]+}", + "runtime-id": "R{.+}" + } + ] + } + ] + }] +}
