Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to capture the start time and end time of the job

Hi all,
I have a requirement where I need to capture jobs start time and end time without using tstatcatcher.
When I use tsatcatcher---tmap---toutput file I am able to capture the start and end time but by doing it I am also getting an extra file each time after the script is run...

How to capture the start and end time of the job without using tstatcatcher? Is there any function available to get the start time and end time?
Labels (2)
11 Replies
_AnonymousUser
Specialist III
Specialist III

Hey,
use the komponents tPreJob and tPostJob. On each Komponent you say "on component ok"--> tSetGlobalVar, here you make sth. like "startTime" : talenddate.getcurrentDate(). do the same in tPostJob in setting an endtime var. these global vars you can set in a tMap to your needed column.

see here:

http://img409.imageshack.us/i/starttimeendtime1.jpg/[/img)
_AnonymousUser
Specialist III
Specialist III

Hey,
use the komponents tPreJob and tPostJob. On each Komponent you say "on component ok"--> tSetGlobalVar, here you make sth. like "startTime" : talenddate.getcurrentDate(). do the same in tPostJob in setting an endtime var. these global vars you can set in a tMap to your needed column.

see here:

Anonymous
Not applicable
Author

Hi Steve,
Thanks for your reply. Will definitly try that option.... meanwhile can you post the images again or you can send it to my email id:mahir.jain@gmail.com.
Thanks...
Anonymous
Not applicable
Author

Hi,
We are trying to capture start time and end time of each job using tstatcatcher and tlogcatcher. If any one already worked on this pl let us know the approach.
Thanks
Sreeni.
Anonymous
Not applicable
Author

Hi,
Is there any error when you use tstatcatcher and tlogcatcher in your job? Have you checked component reference with scenario tStatCatcher and tLogCatcher.
Best regards
Sabrina
Anonymous
Not applicable
Author

Hi Sabrina,
Thank you for your response. No errors in my tstatcatcher or tlogcatcher. Here tstatcatcher return 2 rows with message type begun and end. I want to assign the moment timestamp corresponding to message type "begin" to start time and moment timestamp corresponding to message type "end" to End time.
tStatcatcher 2 records convert to single record (with start and end time ) Any options in tmap to achieve this.
Thanks
Sreeni.
Anonymous
Not applicable
Author

Hi,
Here tstatcatcher return 2 rows with message type begun and end. I want to assign the moment timestamp corresponding to message type "begin" to start time and moment timestamp corresponding to message type "end" to End time.
tStatcatcher 2 records convert to single record (with start and end time )

Could you please elaborate your case with an example with input and expected output values?
Best regards
Sabrina
Anonymous
Not applicable
Author

Hi,
Upon successful job execution My tstatcatcher generates 2 records as show below
2013-12-12 10:48:57|TgurVm|TgurVm|TgurVm|9536|TEST_POSTGRE|ad_lkp_test|_gW35wBxLEeO6I6_upDdnMA|0.1|Default||begin||
2013-12-12 10:58:57|TgurVm|TgurVm|TgurVm|9536|TEST_POSTGRE|ad_lkp_test|_gW35wBxLEeO6I6_upDdnMA|0.1|Default||end||
I want to create a single record using above two records ( Moment info of record with "begin" assign to Start time, Moment info for record with "end" assign to end time as described below)
Start time | end time | job |project
2013-12-12 10:48:57|2013-12-12 10:58:57|ad_lkp_test |TEST_POSTGRE
This will be handled in abinitio, but I am not sure in Talend.
Thanks
Sreeni,
Anonymous
Not applicable
Author

Hi Sreeni
If you just want to get the start time and the end time, you can use the built-in function TalendDate.getCurrentDate() to get the current date on tJava at the beginning of job, instead of tStatCather, and store the start time to a global variable for use later. For example:
tJava_1
|
onsubjobok
|
the main processing of your job
|
onsubjobok
|
tFixedFlowInput_1--main-->tFileOutputDelimited
on tJava_1, get the current date and store it to a global variable, for example:
globalMap.put("start_time", TalendDate.getCurrentDate());
on tFixedFlowInput, define the schema with columns what you want to log, for example, here 4 columns are defined:start_time(date), end_time(date), job(string), project(string), and set its value for each column as below:
start_time: (java.util.Date)globalMap.get("start_time")
end_time: TalendDate.getCurrentDate()
job: jobName //jobName is a global variable that store the job name and can be access anywhere in the job
project: projectName //projectName is a global variable that store the project name and can be access anywhere in the job
Shong