Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to plot a line graph showing how long each job duration takes to run successfully. X axis has dates. Y axis will have duration when job_status is 'Completed'. A job runs parallaly multiple times. I need to perform an aggr operation on job_id and fetch the min of start_time and max of end_time and obtain the difference to get the correct interval. Help form expression.
job_id | start | end | status |
1 | 10 Jan 2024 8:25 AM | 10 Jan 2024 8:35 AM | Completed |
1 | 10 Jan 2024 8:32 AM | 10 Jan 2024 8:38 AM | Completed |
1 | 10 Jan 2024 8:34 AM | 10 Jan 2024 8:45 AM | Completed |
1 | 10 Jan 2024 8:39 AM | 10 Jan 2024 8:50 AM | Completed |
2 | 10 Jan 9:am | 10 Jan 2024 9:10 AM | Completed |
2 | 10 Jan 2024 9:05 AM | 10 Jan 2024 9:20 AM | Completed |
By this table, job i ran for 25 minutes and job 2 ran for 20 minutes.
try this,
Aggr(
Interval(
Max({<status={'Completed'}>} Timestamp(end)) - Min({<status={'Completed'}>} Timestamp(start)),
'mm'
),
job_id
)