on 05-11-2016 4:24 PM
I have the below piece of code in the post running action and does what it is supposed to do and display the required information on the web page i have developed for the business. What i want to have is the run time (Elapsed time) for each job on the list I have. How do I calculate the difference in RUNEND and RUNSTART? Please help
tv = webtable.getTableValueBySearchKeySearchColumnName("<Job Name>","RUNSTART");
tv.setColumnValue(j.getRunStart().toFormattedString("dd-MMM-yyyy HH:mm:ss"));
tv = webtable.getTableValueBySearchKeySearchColumnName("<Job Name>","RUNEND");
tv.setColumnValue(j.getRunEnd().toFormattedString("dd-MMM-yyyy HH:mm:ss"));
tv = webtable.getTableValueBySearchKeySearchColumnName("<Job Name>","STATUS");
tv.setColumnValue(j.getStatus().name().toUpperCase());
Thank You
DateTimeZone.formatDuration(j.getRunEnd().getUTCMilliSecs() - j.getRunStart().getUTCMilliSecs())
Regards Gerben
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When i try to add this i get the below error at compile time. Am I doing any mistake?
method formatDurationEx(long) location: class com.redwood.scheduler.api.date.DateTimeZone tv.setColumnValue((DateTimeZone.formatDurationEx(j.getRunEnd().getUTCMilliSecs() - j.getRunStart().getUTCMilliSecs())));
This is how my line looks like currently without formatting the milli seconds.
tv.setColumnValue((DateTimeZone.formatDuration(j.getRunEnd().getUTCMilliSecs() - j.getRunStart().getUTCMilliSecs())));
Gerben
I ran into another problem while working on this set up.
I have the below piece of line where it fetches the job names.
for (Iterator jt = jcsSession.executeObjectQuery("select Job.* from Job where Job.JobDefinition in (select JobDefinition.UniqueId from JobDefinition where JobDefinition.Name in (<Job Names>)
While calculating the Elapsed time for a job chain, the code is doing it only for the last step of the chain but not giving me the Elapsed time for entire chain.
Can you please guide me with this.
Thank you
Hello,
I hope you are not doing this in the post-running action right? But in a report script or so?
In the post-running action you can always find your own job with jcsJob.
So for the report, you want to limit your searches to not include steps (as they have the same definition name): select Job.* from Job where Job.JobChainStep is null and Job.JobDefinition in (select JobDefinition.UniqueId from JobDefinition where JobDefinition.Name in (<Job Names>)
Regards Gerben
Gerben
Thank you so much for you previous reply. I was able to get the elapsed time of the chain as opposed to only one step.
I also wanted to know if there is any possibility that the web page i have created to make it show a job which is in event wait or running state by using the pre-run or On-change actions? or any other way?
The current set up has post run action defined which updates the table upon job's completion and the same will be transferred over to the web page. I wanted to know if this can be done for event wait and job that is running.
Thank you.
Hi Gerben
Another problem i faced last night. I have a job "abc" which resides in chain "xyz". While i am calculating the run time i want the runtime to be updated in table for job "abc" and a separate row of runtime to be also updated for the chain "xyz"
Due to this select Job.* from Job where Job.JobChainStep is null and Job.JobDefinition where the job chain step is null, i am guessing i am not able to do this.
Can you please advise what should i do to get this done
Thank you
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.