Emit metrics from executed jobs metadata

Context

Once a job is completed, an ActionResult is returns to the client containing ExecutedActionMetadata holding various build related timestamps (see #83 (closed)). Based on these metadata, corresponding build metrics should be emitted on the server's monitoring bus (see #135 (closed)) so that they can be transmitted to an external monitoring system.

Task Description

The initial set of metrics should be, for every build jobs executed:

  • Overall handling time (computed as worker_completed - queued).
  • Input fetching time (computed as input_fetch_completed - input_fetch_start).
  • Execution time (computed as execution_completed - execution_start)
  • Output upload time (computed as output_upload_completed - output_upload_start)

(Based on current ExecutedActionMetadata; that assumes sequential lease execution ie. BuildBox operated in prefetch mode, see #83 (closed) and BuildStream/buildbox#14)

Acceptance Criteria

  • Build metrics can be collected from the monitoring bus output.
Edited by Martin Blanchard