3.2 KiB
3.2 KiB
Forecast Azure DevOps usage using Valet's forecast command
In this lab we will use the forecast command to forecast potential GitHub Actions usage by computing metrics from the historical pipeline data in Azure DevOps. The metrics will be stored on disk in a markdown file and include job metrics for execution time, queue time, and concurrency. We will look at each of these metrics in more depth later in this lab.
- Prerequisites
- Prepare for forecast
- Perform a forecast
- Review forecast report
- Forecasting multiple providers
- Next steps
Prerequisites
TBD
Prepare for forecast
Before we can run the forecast we need to answer a few questions so we can construct the correct command.
- What is the date we want to start forecasting from? 2022-03-02. This should be a date that will give enough data to get a good understanding of the typical usage.
- Where do we want to store the results? ./tmp/forecast_reports. This can be any valid path on the system, but for simplicity it is recommend to use a directory in the root of the codespace workspace.
- What project do we want to run the forecast for? ValetBootStrap. This is the default project name for the labs, if you choose a different name then use that instead.
Using these answers our command becomes:
gh valet forecast azure-devops --output-dir ./tmp/forecast_reports --azure-devops-project YOUR_PROJECT_NAME_HERE --start-date "2022-03-02"
Perform a forecast
- Run the command generated in the previous step in the terminal.
- It will likely return "No Jobs" because we have no pipelines that ran during the timeframe we picked. Actually our demo project has never had any pipelines run so any date we pick will return no jobs.

- lets use the
--source-fileoption of the forecast command to generate a report that we can review. This option is normally used to create reports using data from multiple CI/CD providers, but in this case we can use it to create a report from sample Azure DevOps data. We can view theforecastcommand options by using the help flaggh valet forecast --help
- Run
gh valet forecast azure-devops -o ./tmp/sample_report --source-file-path azure_devops/jobs_data.json - A report should be generated from the sample data!

Review forecast report
Metric Definitions
| Name | Description |
|---|---|
| Median | The middle value |
| P90 | 90% of the values are less than or equal to |
| Min | The lowest value |
| Max | The highest value |
Total Section
Runner Group Sections
- The preceding sections shows the same metrics as the
Totalsection, but are broken out into runner groups. A runner group is a logical grouping of one or more runners.