Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[bug] PR Time to Merge should use average, not greatest

Open
#85 8 comments 0 reactions 1 assignee View on GitHub

@lukaszgryglicki is already working on this.

Since Jan 17, 2025.

Assessment

This issue has not been assessed yet.

Description

bug question

When looking at larger intervals of time, Kubernetes PR-Time-To-Merge uses this calculation:

greatest(percentile_disc(0.5) within group (order by open_to_lgtm asc), 0) as m_o2l_a,

This is wrong; it leads to having a greater value the larger your time interval is, which is deceptive. For aggregating a median, there's two reasonable possibilities: a median of medians, or an average of medians. In practice, those two values are rarely that divergent, and an average is faster to calculate.

Therefore it should be:

avg(percentile_disc(0.5) within group (order by open_to_lgtm asc), 0) as m_o2l_a,

This mistake exists across all cacluations in this view.

Assigning to myself, will submit a PR later.

/assign

Dominant language
Shell
Stars
130
Forks
58
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cncf/devstats

All issues in cncf/devstats

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.