Panel for time elapsed in all jobs

I have a service which throws various state change events, I can inject all those events in InfluxDB and would like to create a dashboard which should tell me the total time taken by respective jobs (by calculating the time difference of first and last event of that particular job).