Feature: A Metric for 'Dev Cycle Time'
Opened this issue · 3 comments
Hello, my team is using this action and find it useful. Thanks for creating this!
Many of these are useful to us, but particularly the github.actions.pull_request_closed.since_opened_seconds
metric is shedding light on our current PR process. We'd love to also be able to measure what someone might refer to as 'Dev Cycle Time' or 'Pull Request Lead Time', which would measure the time from first commit on a feature branch, until the PR is closed.
Is this something you would be willing to add to the action? I imagine this feature might require passing a github token with more permission than the one provided by actions to use the API and get the start time (time of first commit, or head branch creation event) to calculate this metric. I would be happy to put together a PR to implement this.
Thank you for your proposal. That's interesting.
It is possible to get the timestamp of first commit by pulls.listCommits
API https://octokit.github.io/rest.js/v18#pulls-list-commits. For example, https://api.github.com/repos/int128/datadog-actions-metrics/pulls/175/commits. I think author.date
is suitable for the cycle time because committer.date
is updated by rebase operation.
I added the following metrics. Can you check them?
github.actions.pull_request_closed.since_first_authored_seconds
Time from the authored time of the first commit until closed
github.actions.pull_request_closed.since_first_committed_seconds
Time from the committed time of the first commit until closed