Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I would like to know if there is a global variable on the duration of a job. This data is automatically logged in the talend logs. I know it can also be retrieved via the tChronometerStop component.
But is there a global variable associated with this data (as for the name of the job (jobName), the name of the project (projectName), etc.).
My need, logging the duration of my job during its execution. If I have to do it with tChronometer, can I run several tChronometerStop without tChronometerStart?
Thank you
OK , found what I want :
Math.toIntExact(TalendDate.getCurrentDate().getTime() - startTime)
startTime is a long, I compare this long with the current date (convert in long with getTime()).
I convert long to int with Math.toIntExact.
What i get : the duration in ms.
Hi,
yes, you can use as many chronometers as you need, without tChronometrStart each of them will count time from the Job start.
if you already enable logs and stats collection - you could also extract it from the stats table (or file) by the Job pid
OK , found what I want :
Math.toIntExact(TalendDate.getCurrentDate().getTime() - startTime)
startTime is a long, I compare this long with the current date (convert in long with getTime()).
I convert long to int with Math.toIntExact.
What i get : the duration in ms.