Time since job state has changed (DB)

Discussion created by TimRiedel607946 on May 2, 2017

Is there a way to get the time since the last change of the state of a job from the DB?

For example:
A job changes from state active to unknown at 5 A.M. 
I need a query which returns the time between the change to unknown and now. 

I know there is the table AWS, which helps to get the waiting times of jobs, but it doesn't have informations about how long a job is in other states like unknown, generating etc.

Kind regards,