Job Batching introduced by Laravel 8 allows to execute jobs in batches and inspect Job Batch states. Illuminate\Bus\Batch
instance contain such information as $createdAt
, $cancelledAt
, $finishedAt
information.
I'm interested on inspecting the execution duration of the Job Batch (Not the duration when the Batch was created and finished/canceled, but the sum of duration of all contained Jobs).
How this approach can be implemented?
p.s. finishedAt - createdAt
approach won't work, as other Batch jobs can be executed between the one Batch job (which will affect the whole duration of the Job Batch, but not the execution duration)