4.7 KiB
Forecast potential build runner usage
In this lab you will use the forecast command to forecast potential GitHub Actions usage by computing metrics from completed pipeline runs in your Azure DevOps project.
Prerequisites
- Followed the steps here to set up your GitHub Codespaces environment and bootstrap an Azure DevOps project.
- Completed the configure lab.
Perform a forecast
Answer the following questions before running the forecast command:
-
What is the Azure DevOps organization name that you want to audit?
- :organization. This should be the same organization used in the setup steps here
-
What is the Azure DevOps project name that you want to audit?
- :project. This should be the same project name used in the setup steps here
-
Where do you want to store the results?
tmp/forecast
Steps
-
Navigate to the codespace terminal.
-
Run the following command from the root directory:
gh actions-importer forecast azure-devops --output-dir tmp/forecastNote: The Azure DevOps organization and project name can be omitted from the
forecastcommand because they were persisted in the.env.localfile in the configure lab. You can optionally provide these arguments on the command line with the--azure-devops-organizationand--azure-devops-projectCLI options. -
The command will output a message that says "No jobs found" because no jobs have been executed in your bootstrapped project.
-
If you inspect the help menu using the
gh actions-importer forecast --helpcommand, you will see a--source-file-pathoption. You can use this option to perform aforecastusing json files that are already present on the filesystem. These labs come bundled with sample json files located here. -
Run the following
forecastcommand while specifying the path to the sample json files:gh actions-importer forecast azure-devops --output-dir tmp/forecast --source-file-path azure_devops/bootstrap/jobs.json -
The command will list all the files written to disk when the command succeeds.
Review the forecast report
The forecast report, logs, and completed job data will be located within the tmp/forecast folder.
- Find the
forecast_report.mdfile in the file explorer. - Right-click the
forecast_report.mdfile and selectOpen Preview. - This file contains metrics used to forecast potential GitHub Actions usage.
Total
The Total section of the forecast report contains high level statistics related to all the jobs completed after the --start-date CLI option:
- Job count: **84**
- Pipeline count: **32**
- Execution time
- Total: **82 minutes**
- Median: **0 minutes**
- P90: **2 minutes**
- Min: **0 minutes**
- Max: **4 minutes**
- Queue time
- Median: **0 minutes**
- P90: **1 minutes**
- Min: **0 minutes**
- Max: **5 minutes**
- Concurrent jobs
- Median: **0**
- P90: **0**
- Min: **0**
- Max: **5**
Here are some key terms of items defined in the forecast report:
- The
Job countis the total number of completed jobs. - The
Pipeline countis the number of unique pipelines used. Execution timedescribes the amount of time a runner spent on a job. This metric can be used to help plan for the cost of GitHub hosted runners.- This metric is correlated to how much you should expect to spend in GitHub Actions. This will vary depending on the hardware used for these minutes. You can use the Actions pricing calculator to estimate a dollar amount.
Queue timemetrics describe the amount of time a job spent waiting for a runner to be available to execute it.Concurrent jobsmetrics describe the amount of jobs running at any given time. This metric can be used to define the number of runners a customer should configure.
Additionally, these metrics are defined for each queue of runners defined in Azure DevOps. This is especially useful if there are a mix of hosted/self-hosted runners or high/low spec machines to see metrics specific to different types of runners.


