The first one extracts the start time and duration (in seconds) of each crontask execution in the last week.
select
crontaskname,
to_char(starttime,'YYYY-MM-DD HH24:MI:SS') as starttime,
(endtime-starttime)*24*60*60 as duration
from CRONTASKHISTORY
where endtime>sysdate-7
order by starttime;
I typically import the output of this query into an Excel spreadsheet and analyze it sorting by whatever column I need. Furthermore, you can create a pivot table or chart to analyze the data. This is an example of what can be achieved:
If you are not familiar with Excel, here is a query that generates the same output straight from an SQL query:
select
crontaskname,
sum((endtime-starttime)*24*60*60) as totalduration
from CRONTASKHISTORY
where endtime>sysdate-7
group by crontaskname;
Source:http://maximodev.blogspot.com/2011/11/crontask-analysis-and-optimization.html
Tidak ada komentar:
Posting Komentar