Skip to content

Instantly share code, notes, and snippets.

@adamzero1
Created August 9, 2022 12:25
Show Gist options
  • Save adamzero1/db76ee25df84f064cbd1b431b275b0d2 to your computer and use it in GitHub Desktop.
Save adamzero1/db76ee25df84f064cbd1b431b275b0d2 to your computer and use it in GitHub Desktop.
Report on average,min and max run time (in seconds) of all completed jobs in Magento 2
select job_code,
avg(timestampdiff(second, executed_at, finished_at)) as average_run_time,
min(timestampdiff(second, executed_at, finished_at)) as min_run_time,
max(timestampdiff(second, executed_at, finished_at)) as max_run_time
from cron_schedule where executed_at is not null and finished_at is not null group by job_code order by max(timestampdiff(second, executed_at, finished_at)) desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment