A tool to calculate the DORA Lead Time metric
Project description
DORA Lead Time Metric
DORA Lead Time for Changes
Lead Time for Changes is one of the four key DORA (DevOps Research and Assessment) metrics that measure software delivery performance. It measures the time it takes from when code is committed to when it is successfully running in production. A shorter lead time indicates an organization's ability to respond quickly to customer needs and fix problems rapidly.
This Python package calculates lead time by connecting data from Jira and GitHub. The calculation involves going from Projects → Releases → Stories → Pull Requests → Commits, calculating the lead time for each pull request, and averaging those over a given time period.
How to Use
See Calculate the DORA Lead Time Metric in Python for a detailed explanation of how to use this code. The code is at sualeh/dora-lead-time-metric.
Build
Install
- Python 3.13 or higher
- Poetry (Python dependency manager)
Clone the repository:
git clone https://github.com/sualeh/dora-lead-time-metric.git
cd dora-lead-time-metric
Install dependencies using Poetry:
poetry install
Create an .env file in the project root based on .env.example
Activate the Poetry environment:
poetry shell
Run the main application:
python -m dora_lead_time.main
Generate reports with code similar to the following:
from dora_lead_time.lead_time_report import LeadTimeReport
# Initialize the report generator
report = LeadTimeReport("releases.db")
# Generate a monthly report
monthly_data = report.monthly_lead_time_report(
["PROJECT1", "PROJECT2"],
date(2023, 1, 1),
date(2023, 12, 31)
)
# Visualize the report
plt = report.show_plot(monthly_data, title="Monthly Lead Time", show_trend=True)
plt.savefig('lead_time_trend.png')
With Docker
Build the Docker image:
docker build -t dora-lead-time-metric .
or download it from Docker Hub:
docker pull sualeh.fatehi/dora-lead-time-metric
Run the container:
docker run -it --rm \
--env-file .env \
-v "$(pwd)/data:/data" \
dora-lead-time-metric
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dora_lead_time_metric-0.2.2.tar.gz.
File metadata
- Download URL: dora_lead_time_metric-0.2.2.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e634e4061816476b9b84a899d4919963f60af3b0b1727160a009f150eae87986
|
|
| MD5 |
9ee9fcb28b737de2bb25e2d28b31fe7f
|
|
| BLAKE2b-256 |
a30464ae5a7670c2b6ddb54a1de1ddc3a4313acdc004bf55bcb1b0f707f606cd
|
Provenance
The following attestation bundles were made for dora_lead_time_metric-0.2.2.tar.gz:
Publisher:
publish-pypi.yml on sualeh/dora-lead-time-metric
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dora_lead_time_metric-0.2.2.tar.gz -
Subject digest:
e634e4061816476b9b84a899d4919963f60af3b0b1727160a009f150eae87986 - Sigstore transparency entry: 201085302
- Sigstore integration time:
-
Permalink:
sualeh/dora-lead-time-metric@965a261aec2b0cc476f8e0a05974779d25d39585 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/sualeh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@965a261aec2b0cc476f8e0a05974779d25d39585 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dora_lead_time_metric-0.2.2-py3-none-any.whl.
File metadata
- Download URL: dora_lead_time_metric-0.2.2-py3-none-any.whl
- Upload date:
- Size: 24.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18bcd05d6400bf713b5b4c1a41a3585170f9865c0068c1725f4c7286c2b6bdaf
|
|
| MD5 |
2de79fdc57bc41db8f3ab4b55befa171
|
|
| BLAKE2b-256 |
37390f1ef4e266f57affff6320b4b5c1300b64533a540268664945ced96ed8e1
|
Provenance
The following attestation bundles were made for dora_lead_time_metric-0.2.2-py3-none-any.whl:
Publisher:
publish-pypi.yml on sualeh/dora-lead-time-metric
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dora_lead_time_metric-0.2.2-py3-none-any.whl -
Subject digest:
18bcd05d6400bf713b5b4c1a41a3585170f9865c0068c1725f4c7286c2b6bdaf - Sigstore transparency entry: 201085329
- Sigstore integration time:
-
Permalink:
sualeh/dora-lead-time-metric@965a261aec2b0cc476f8e0a05974779d25d39585 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/sualeh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@965a261aec2b0cc476f8e0a05974779d25d39585 -
Trigger Event:
push
-
Statement type: