Skip to content

Introduce new MR lead time metric that ignores weekends

Reuben Pereira requested to merge rp/lead-time-ignore-weekends into master

What does this MR do and why?

Describe in detail what your merge request does and why.

Introduce a new metric called delivery_deployment_merge_request_adjusted_lead_time_seconds whose value is the lead time of each MR, adjusted to ignore weekends between merge time and deploy time.

Times are in UTC, so weekend is considered to start at 00:00 UTC on Saturday and end at 00:00 UTC on Monday. This isn't exactly true since RMs in AMER usually end their day after 00:00 UTC on Friday. But this is balanced by the fact that EMEA RMs on Monday usually start well after 00:00 UTC. This isn't ideal, but is better than the current status where we consider the entire weekend as missed time, which skews our average lead time.

For MRs merged in the weekend, lead time count will start from Monday.

This new metric can be used alongside the existing delivery_deployment_merge_request_lead_time_seconds metric (which does not exclude weekends) to see the difference that ignoring weekends has on our monthly MTTP metric.

Note that this MR does not affect our official MTTP metric which is calculated in Periscope, not Prometheus.

Here are the lead time values that will be calculated by the changes in this MR for common situations:

  • If an MR is merged on Tuesday, and deployed on Wednesday, the entire time difference (deployed_at - merged_at) will be calculated as adjusted lead time.
  • If an MR is merged on Friday UTC time, and deployed on Saturday UTC time, the entire time difference will be calculated as adjusted lead time.
  • If an MR is merged on Saturday UTC time, and deployed on Saturday UTC time, the entire time difference will be calculated as adjusted lead time.
  • If an MR is merged on Friday UTC time, and deployed on Monday UTC time, the Friday time will be counted, and the Monday time will be counted. Saturday and Sunday will be excluded.
  • If an MR is merged on Saturday UTC time, and deployed on Monday UTC time, only Monday will be counted as the lead time. Saturday and Sunday will be excluded.

Author Check-list

  • Has documentation been updated?
Edited by Reuben Pereira

Merge request reports