Last active
August 16, 2016 20:59
-
-
Save steverobbins/b66b0de4999809f20b3e to your computer and use it in GitHub Desktop.
This file contains 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
set @datetime = '2015-03-25 10:30:00'; | |
set @threshold = 15; | |
select | |
job_code, | |
status, | |
messages, | |
executed_at, | |
finished_at, | |
timediff(finished_at, executed_at) run_time | |
from cron_schedule | |
where ( | |
executed_at > date_sub(@datetime, interval @threshold minute) | |
and executed_at < date_add(@datetime, interval @threshold minute) | |
) or ( | |
finished_at > date_sub(@datetime, interval @threshold minute) | |
and finished_at < date_add(@datetime, interval @threshold minute) | |
) | |
order by executed_at, finished_at; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment