An application that generates DevOps deployment metrics from GitHub repositories using a GitHub Action workflow to deploy a product.
This application reads historical data for workflows from GitHub. The application looks at records for the deployment workflow and generates Deployment Frequency, Change Fail Percentage and a Mean Time to Recover metrics for fixed-width reporting periods.
Metrics will be reported from a configured starting time to the present, with results reported in fixed-width periods. The reporting period width is configurable from 1 day on up.
Deployment Frequency is a simple calculation of the number of successful deployments per day in the reporting period. For example, if there is a 14-day reporting period, and there are 28 successful deployments by the workflow during that period, the deployment frequency would be 2.0.
Change Fail Rate is a simple ratio of the number of failed deployments over the total number of deployments in a given reporting period, expressed as a percentage. If all the deployments fail, the change fail rate will be 100.0. If all the deployments succeed, the change fail rate will be 0.0.
The deployment Mean Time to Recover (MTTR) mean of the deployment time-to-recover in a given reporting period. The deployment time-to-recover is the time between a failed deployment and the next successful deployment. The metric is reported in hours.
- Generates CSV files with deployment frequency, deployment change-fail percentage and deployment mean time to recover metrics.
- Generates CSV file with deployment log record
- Python 3.9+
- Poetry (installation instructions provided here)
- Supported OS: Windows 10, Windows 11, Linux, MacOS
poetry install
A configuration file must be created and passed to the application at run time.
# Keys
title = "Sample devops-deployment-metrics configuration"
[general]
time-slice-days = 7
start-date = 2023-09-01T00:00:01
date-format = "%Y-%m-%d"
timezone = "UTC"
[[repositories]]
owner = "ccsq-isfcs"
repo = "security-findings-lambda"
workflow_filename = "cicd.yaml"
deployment-frequency = "df"
change-fail-rate = "cfr"
mean-time-to-recover = "mttr"
deployment-log = "deployments"
time-slice-days: duration used to group metric data start-date: the start date of metric collection (end date is automatically assumed to be current day) owner: Github organization name repo: repository name workflow_filename: GitHub Action workflow filename for the workflow that deploys the product. Just the filename, not the path.
poetry run devops-deployment-metrics -v -c my-config.toml
Please see the Command-line Reference for more details.
Contributions are very welcome. To learn more, see the Contributor Guide.
Distributed under the terms of the [MIT license], DevOps Deployments Metrics is free and open source software.
If you encounter any problems, please file an issue along with a detailed description.
This project was generated from @cjolowicz's Hypermodern Python Cookiecutter template.