Last active
December 20, 2019 04:50
-
-
Save gumdropsteve/386e25162061980bf1db137e97831ce8 to your computer and use it in GitHub Desktop.
Example of how to query your BlazingSQL logs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This query determines the data load time and total time for all queries, showing the latest ones first. | |
# load time and total time being the maximum load time and total time for any node. | |
log_query = """ | |
SELECT | |
MAX(end_time) as end_time, query_id, | |
MAX(load_time) AS load_time, MAX(total_time) AS total_time | |
FROM ( | |
SELECT | |
query_id, node_id, | |
SUM(CASE WHEN info = 'evaluate_split_query load_data' THEN duration ELSE 0 END) AS load_time, | |
SUM(CASE WHEN info = 'Query Execution Done' THEN duration ELSE 0 END) AS total_time, | |
MAX(log_time) AS end_time | |
FROM | |
bsql_logs | |
WHERE | |
info = 'evaluate_split_query load_data' | |
OR info = 'Query Execution Done' | |
GROUP BY | |
node_id, query_id | |
) | |
GROUP BY | |
query_id | |
ORDER BY | |
end_time DESC | |
""" | |
# run query (type(log_result)==cudf.core.dataframe.DataFrame) | |
log_result = bc.log(log_query) | |
# display result | |
print(log_result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment