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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Parallel job - getting the statistics

Hi, I have a main job when executed, runs 15 jobs in parallel. Each job has a table to write (insert or update) from sql server to mysql.
I want to get the execution time of each job and the number of rows that were affected. I want the table_name,inserted_rows, updated_rows,job_completion_time
So I run this job 4 times in a day. And the data in this log table must have information for every run
I am using TOS - 6.1.1
Any ideas on how I can achieve this would be of  great help
Thanks in advance
Rathi

Labels (2)
5 Replies
Anonymous
Not applicable
Author

Hi Rathi,
Create a table with columns table_name,inserted_rows, updated_rows,job_completion_tim Asume the table name to be "JobTracker".
Create an autoincrement column in the JobTracker table to capture the deatils of the job with an id assume jobtrackerid.

For all the outputcomponents u would have global variable available , just click on drop down of the output component in the outline
which would be available on the bottom left.The you would find the global variable like NBLine_Inserted etc.
Just drag and drop to the required field to get the recoreds inserted or updated.

at end of each job populate the details into the table.

tfixedflowinput ---> tmysqloutput(JobTracker Table).

Regards,
Prince

 
Anonymous
Not applicable
Author

For the execution time at start of each job create a global variable var1 (var1 = TalendDate.getCurrentDate())  to store the talend current datetime. 
similarly at the end of each job apply the below logic.
var1 = TalendDate.getCurrentDate() - var1;
Anonymous
Not applicable
Author

Hi Prince,
Thanks a lot for explaining.
So, should the flow be tmssqlinput --> tmap --> tmysqloutput(maintable) -- > tfixedflowinput --> tmysqloutput(jobtracker)
The same sequence will be repeated 15 times for different tables. All 15 jobs will try to insert into jobtracker, will there not be any lock issues? 
Also, how do I get the execution time for each job?
Thanks
Rathi
Anonymous
Not applicable
Author

for the exection time:
tjava1--->on subjob ok --->Main JOb ----->onSubjobOk--->tjava2.--->tfixedflow---->JobTracker
In tJava1:Create a variable V1 = TalendDate.getCurrentDate()
In tJava2:V1 = TalendDate.getCurrentDate()-V1
In tFixedflowinput in the column job_completion_tim privide context.V1
Regarding locks no it would nt .
please don t forget to  close the JobTracker connection
example: tmysqlConnection --> tfixedflowinput--->jobtracker --->tmysqlcommit(Please check the checkbox close connection)
Anonymous
Not applicable
Author

Hi,
I tried creating the job as you said, but V1 was not recognized globally, so used a tsetglobalvar. 
I was reading and came across tstatscatcher,tflowmetercatcher, tlogcatcher. What method must I opt for , these components or the method you have suggested?
Thanks
Rathi