Lead time
Lead time measures how long it takes for work to move from creation to completion. In software delivery, it represents the time required for a change to travel through the development pipeline, from the moment work begins to the moment it is successfully delivered.
Because it captures the full journey of a change, lead time is one of the core DORA metrics and reflects the overall speed of your development and release process. A lower average lead time usually indicates smaller changes, strong automation, and efficient collaboration between teams.
Before you begin
For this tile we'll use the Azure DevOps as the data source and use the WIQL data stream to query the fields we need to calculate lead times.
However the principles used to display this metric can be applied to any data source you use, such as Jira for example.
Creating an average lead time tile
This tile displays the average lead time for completed work items within the selected timeframe.
Configuring the tile
Configure the following in the tile editor:
- Data Source: Select Azure DevOps.
- Data Stream: Select WIQL Query.
- Parameters > WIQL query: Enter a query to return the necessary date fields to calculate lead time. We'll included the
{{timeframe.start}}and{{timeframe.end}}parameters so that the tile responds to the specified timeframe.
For example:SELECT [System.Id], [System.CreatedDate], [Microsoft.VSTS.Common.ActivatedDate], [Microsoft.VSTS.Common.ClosedDate], [System.State] FROM WorkItems WHERE [System.State] = 'Closed' AND [Microsoft.VSTS.Common.ClosedDate] >= '{{new Date(timeframe.start).toISOString().substring(0,10)}}' AND [Microsoft.VSTS.Common.ClosedDate] <= '{{new Date(timeframe.end).toISOString().substring(0,10)}}' ORDER BY [Microsoft.VSTS.Common.ClosedDate] DESC Timeframe: Select the timeframe you want to track. Note that after adding a monitor or configuring a KPI the Use dashboard timeframe option is disabled.
- SQL Analytics: Enable the toggle, then configure the following:
- SQL > Query: Enter a query to calculate the lead time. For example:
SELECT AVG(DATEDIFF('minute', "Created Date", "Closed Date")) AS avg_lead_time_minute FROM dataset1 - Columns: Click Edit next to Avg lead time and configure the following:
- Type: Select Minutes.
- Decimal places: Enter 0.
- Click Save to update the column.
- SQL > Query: Enter a query to calculate the lead time. For example:
- Click Save to save the tile config.
Creating an lead time frequency tile
This tile helps you understand how delivery speed changes over time by highlighting trends in delivery efficiency and makes it easier to identify when lead time begins to increase.
Configuring the tile
Configure the following in the tile editor:
- Data Source: Select Azure DevOps.
- Data Stream: Select WIQL Query.
- Parameters > WIQL query: Enter a query to return the necessary date fields to calculate lead time. We'll included the
{{timeframe.start}}and{{timeframe.end}}parameters so that the tile responds to the specified timeframe.
For example:SELECT [System.Id], [System.CreatedDate], [Microsoft.VSTS.Common.ActivatedDate], [Microsoft.VSTS.Common.ClosedDate], [System.State] FROM WorkItems WHERE [System.State] = 'Closed' AND [Microsoft.VSTS.Common.ClosedDate] >= '{{new Date(timeframe.start).toISOString().substring(0,10)}}' AND [Microsoft.VSTS.Common.ClosedDate] <= '{{new Date(timeframe.end).toISOString().substring(0,10)}}' ORDER BY [Microsoft.VSTS.Common.ClosedDate] DESC Timeframe: Select the timeframe you want to track. Note that after adding a monitor or configuring a KPI the Use dashboard timeframe option is disabled.
- SQL Analytics: Enable the toggle, then configure the following:
- SQL > Query: Enter a query to calculate the lead time and then group and order by
date. For example:SELECT "Created Date" as date, AVG(DATE_DIFF('hour', "Created Date", "Closed Date")) AS avg_lead_time_hours FROM dataset1 GROUP BY date ORDER By date DESC - Columns: Click Edit next to Date and configure the following:
- Output Format: Enter your preferred date format. E.g. MM/dd/yyyy or dd/MM/yyyy.
- Click Save to update the column.
- SQL > Query: Enter a query to calculate the lead time and then group and order by
- Visualization: Select Line then configure the following:
- Mapping > X-Axis: select Date.
- Mapping > Y-Axis: select Avg Lead Time.
- X-Axis > Label: Enter Date.
- Y-Axis > Label: Enter Avg Lead Time.
- Options: Enable the following toggles:
- Shading
- Grid lines
- Trend line
- Click Save to save the tile config.