# 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.
Before we can run the forecast we need to answer a few questions so we can construct the correct command.
1) 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.__
2) 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.__
3) 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.__
- 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-file` option 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 the `forecast` command options by using the help flag `gh valet forecast --help`
We can see there were 60 pipelines that ran and they contained 186 jobs. The number of jobs is expected to be equal or larger than pipelines because a pipeline is typically a collection of jobs.
-`Execution time` shows the metrics for the time a job __took to run__. Looking closer we can see during our forecast timeframe the total job run time was 153 minutes, with 90% of the jobs finishing under 1 minute, and the longest job taking 4 minutes. The `Min` and `Median` are 0 because they were less than a minute and was rounded down to 0.
- Execution time
- Total: **153 minutes**
- Median: **0 minutes**
- P90: **1 minutes**
- Min: **0 minutes**
- Max: **4 minutes**
-`Queue time` shows the metrics for how long jobs __waited__ for a runner to be available.
- Queue time
- Median: **0 minutes**
- P90: **1 minutes**
- Min: **0 minutes**
- Max: **5 minutes**
-`Concurrent jobs` show the metrics for how many jobs were run at the __same time__.
- The preceding sections shows the same metrics as the `Total` section, but are broken out into runner groups. A runner group is a logical grouping of one or more runners. In our case we have `Azure Pipelines` and `Default`. These sections can be used to identify runner types that needed to be increased or decreased when moving to GitHub Actions. Looking at the report the `Default` group was only used for 3 jobs and a ran for a total of 1 minute. This might be a group of runners we do not need to migrate to Actions.
This concludes the Valet labs for Azure Devops, if you are interested exploring the power of Valet more. You can leverage the lab setup and modify and add new pipelines that more closely match your needs and try out the commands again!