Skip to content

Instantly share code, notes, and snippets.

@joffilyfe
Last active September 9, 2020 14:14
Show Gist options
  • Save joffilyfe/dff33f6aa9fc70b3ec252cedb3fa1db2 to your computer and use it in GitHub Desktop.
Save joffilyfe/dff33f6aa9fc70b3ec252cedb3fa1db2 to your computer and use it in GitHub Desktop.
Tempo médio de processamento por task
           Task           | Média de execução em segundos |     Intervalo selecionado     
--------------------------+-------------------------------+-------------------------------
 register_update_docs_id  |              260.615122870588 | Entre 08-09-2020 e 09-09-2020
 link_documents_task_id   |              51.7884887882353 | Entre 08-09-2020 e 09-09-2020
 optimize_package_task_id |               45.316615255814 | Entre 08-09-2020 e 09-09-2020
 list_docs_task_id        |              29.0560280229885 | Entre 08-09-2020 e 09-09-2020
 delete_docs_task_id      |               28.986991954023 | Entre 08-09-2020 e 09-09-2020
           Task           | Média de execução em segundos |     Intervalo selecionado     
--------------------------+-------------------------------+-------------------------------
register_update_docs_id  |              111.694401919118 | Entre 02-09-2020 e 08-09-2020
link_documents_task_id   |              11.1879265441176 | Entre 02-09-2020 e 08-09-2020
optimize_package_task_id |              7.71604560294118 | Entre 02-09-2020 e 08-09-2020
delete_docs_task_id      |              3.18003157553957 | Entre 02-09-2020 e 08-09-2020
list_docs_task_id        |              2.49617026618705 | Entre 02-09-2020 e 08-09-2020
-- Processamento mais atual e mais lento
SELECT
task_id AS "Task",
avg(duration) AS "Média de execução em segundos",
'Entre 08-09-2020 e 09-09-2020' AS "Intervalo selecionado"
FROM
task_instance
WHERE
dag_id = 'sync_documents_to_kernel'
AND duration > 0
AND end_date is not null
AND start_date > '2020-09-08 12:00:00.000000+00'
AND end_date < '2020-09-09 14:00:00.000000+00'
GROUP BY
task_id
ORDER BY
avg(duration) DESC;
-- Processamento anterior
SELECT
task_id AS "Task",
avg(duration) AS "Média de execução em segundos",
'Entre 02-09-2020 e 08-09-2020' AS "Intervalo selecionado"
FROM
task_instance
WHERE
dag_id = 'sync_documents_to_kernel'
AND duration > 0
AND end_date is not null
AND start_date < '2020-09-08 13:00:00.000000+00'
AND start_date > '2020-09-02 00:00:00.000000+00'
GROUP BY
task_id
ORDER BY
avg(duration) DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment