Add WorkerActivity start time and average/min/max processing time
Refs #1394 (closed)
- A new
WorkerActivity.started
DateTime field is introduced. -
started
is set to the existingupdated
DateTime for WorkerActivities that areStarted
at the time of the migration. - A constraint ensures that we always set
started
when trying to update the activity to astarted
state. - The complex QuerySet to retrieve the WorkerActivity statistics has been deduplicated from the CorpusWorkersActivity and ProcessWorkerActivity endpoints.
-
ActivityManager.bulk_insert
no longer accepts astate
argument.queued
was the only state that was actually used, and handling setting the start time when usingstate=started
would have been a mess with the raw SQL query as well as completely useless, so I just removed the ability to create activities asstarted
.