Lesson 2 of 7 DevOps Metrics and Dashboards

Metrics and Queries for Project Planning

This lesson explains velocity, burndown and forecasting, and how work item queries and Analytics supply them.

Learning outcomes

After completing this lesson, you will be able to:

  • Explain the proper use of velocity.
  • Compare burndown and burnup charts.
  • Read and write a WIQL query.
  • Distinguish Analytics views from OData queries.

Planning measures

Velocity

Velocity is the amount of work a team completes in a sprint, measured in story points, effort or a count of items. It is calculated from the team's own estimates, so it cannot be compared between teams. A team that estimates in larger numbers would appear faster without having delivered more. Its proper use is forecasting, by using a team's recent average to judge how much work fits in future sprints. Using velocity as a performance target usually inflates estimates, and it destroys the value of the measure.

Burndown and burnup

A burndown chart shows remaining work against time. A line that stays above the ideal trend shows that the sprint will not finish its plan. A burnup chart shows completed work against total scope, and it has one advantage: scope changes are visible as a rising top line, whereas a burndown can hide added scope.

Forecasting

Azure Boards has a forecast tool on the backlog, which applies an assumed velocity to show which items fit into future sprints. Delivery Plans show the sprint schedules of several teams on a calendar, so that dependencies and dates are visible. Teams using Kanban forecast from throughput, using the number of items completed per week.

The following diagram compares ranking teams by velocity with comparing outcome measures.

Why not to rank teams by velocity. Each team estimates on its own scale, so velocity is not comparable, and making it a target encourages inflated estimates. Outcome measures such as cycle time, deployment frequency and change failure rate are defined the same way for every team, though they still need each team's context.
The scenario is illustrative.
True or false

Velocity, burndown and burnup

Exam skills 1.2.2

Check how planning measures should and should not be used.

Log in to try this activity Interactive activities are free with an account.

Work item queries and WIQL

Azure Boards queries retrieve lists of work items. The query editor builds them visually, and each query is stored as Work Item Query Language (WIQL), which resembles SQL. Queries may be flat lists, or may follow links as work items and direct links or a tree of work items. The following WIQL statement finds active bugs in one area path that have not changed for two weeks.

SELECT [System.Id], [System.Title], [System.AssignedTo]
FROM WorkItems
WHERE [System.TeamProject] = @project
  AND [System.WorkItemType] = 'Bug'
  AND [System.State] = 'Active'
  AND [System.AreaPath] UNDER 'Payments\Checkout'
  AND [System.ChangedDate] < @today - 14
ORDER BY [Microsoft.VSTS.Common.Priority]

The macros @project, @me and @today make a query reusable, so a shared query works for each user or project. @currentIteration keeps a sprint query correct as sprints change. The operator UNDER includes child area paths. The same query can be run from a script with az boards query --wiql. A saved shared query can feed a Chart for Work Items widget.

GitHub Issues has a filter syntax, for example is:issue is:open label:bug -label:triaged, and the GraphQL API supports programmatic reporting across repositories.

Match the pairs

Parts of a WIQL query

Exam skills 1.2.2

Match each WIQL element with what it does.

Log in to try this activity Interactive activities are free with an account.

Analytics for larger reporting needs

Work item queries return the current state of items. For trends over time, Azure DevOps offers Analytics, a reporting store that records changes. Analytics supplies the built-in widgets, and it can be reached in two further ways.

Analytics views
DataAzure Boards work items only
Skill neededLow; created in the web interface
Typical consumerPower BI
Choose when You need a work item data set for Power BI with no query writing.
OData queries
DataWork items, pipelines and test data
Skill neededHigher; queries are written by hand
Typical consumerPower BI and custom tools
Choose when You need pipeline or test data, or a precisely shaped result.

An Analytics view is created under Boards > Analytics views. It defines filters, fields and a history period, such as a rolling period or all history, and it provides a flat list of work items to Power BI. Microsoft states that Analytics views support only Azure Boards data, so they do not meet a requirement for pipeline reporting.

Sort into groups

Analytics view or OData query?

Exam skills 1.2.2

Choose the Analytics route for each reporting need.

Log in to try this activity Interactive activities are free with an account.
Worked example

Comparing teams

A director wants a dashboard ranking eight teams by velocity, in order to allocate a bonus. What should you recommend?

You should recommend against the ranking, because each team estimates on its own scale, so velocity is not comparable between teams, and using it as a target encourages inflated estimates. If the director wants to compare delivery, measures of outcomes such as cycle time, deployment frequency and change failure rate are defined in the same way for all teams, although they should still be read in the context of each team's work.

Check yourself

Which query macro keeps a sprint query correct after a sprint ends?

Show answer

@currentIteration. It resolves to the team's current sprint, so the query does not need to be edited.

Exam Tips

Remember for the exam

  • Velocity is for a team's own forecasting; it is not comparable across teams.
  • A burnup chart shows scope changes that a burndown can hide.
  • @me, @project, @today and @currentIteration make queries reusable.
  • Trends over time need Analytics rather than a work item query.
  • Analytics views cover Azure Boards data only.