Calculate Average PR Merge Time
Compute the average number of days from PR creation to merge for all merged PRs in December 2024, using correct timestamp parsing and filtering.
- License 许可
- MIT
- 最近更新
- 2026-10-02
- Stars
- ★ 93
- Forks
- 8
01 前言 Front Matter
- name
- Calculate Average PR Merge Time
- description
- Compute the average number of days from PR creation to merge for all merged PRs in December 2024, using correct timestamp parsing and filtering.
03 SKILL.md 正文
Calculate Average PR Merge Time
Overview
Calculate the average time-to-merge in days (rounded to 1 decimal place) for PRs that were successfully merged during December 2024.
Step 1: Filter Merged PRs Only
From the PR query results, identify only PRs where:
mergedAtis NOT nullstateequals"MERGED"(verify this is the actual state value)
Do NOT include closed-but-unmerged or open PRs in this calculation.
Step 2: Parse Timestamps Correctly
For each merged PR, extract:
createdAt: The PR creation timestamp (ISO-8601 format, e.g.,2024-12-15T10:30:45Z)mergedAt: The PR merge timestamp (ISO-8601 format)
Critical: Use the creation date as the start point, not any other date field.
Step 3: Convert to Days
For each PR:
- Parse both timestamps as datetime objects (handle timezone info — typically UTC)
- Calculate the difference:
mergedAt - createdAt - Convert to total days (may be a float with decimal)
- Example: If a PR was created on 2024-12-01 at 00:00:00 and merged on 2024-12-02 at 12:00:00, that's 1.5 days
Step 4: Compute Average
- Sum all day values from step 3
- Divide by the count of merged PRs
- Round the result to exactly 1 decimal place (e.g., 1.2, 15.8, 0.5)
Step 5: Validation Check
If your average is significantly higher than expected (e.g., 16+ days):
- Verify you're only including merged PRs (check
mergedAt != null) - Confirm you're measuring from
createdAt(not some other field) - Check if any timestamp parsing errors are inflating the values
- Inspect a few sample PRs manually to spot-check the calculation
Example Pseudocode
merged_prs = [pr for pr in prs if pr.mergedAt is not null and pr.state == "MERGED"]
days_list = []
for pr in merged_prs:
created = parse_datetime(pr.createdAt)
merged = parse_datetime(pr.mergedAt)
days = (merged - created).total_seconds() / 86400
days_list.append(days)
avg = sum(days_list) / len(days_list)
rounded_avg = round(avg, 1)
04 同仓库更多 Skills
object_counter
Count occurrences of an object in the image using computer vision algorithm.
travel-planning-workflow
Invoke this skill when performing travel planning. It defines a structured workflow for generating itineraries. Following this workflow is essential to ensure the final plan satisfies user requirements.
bundled-dataset-search-tool
invoke this skill when you need to perform database search for travel planning. This skill provides some useful pre-packaged tools to look up accommodations, attractions, cities, driving distance, flights, and restaurants from the bundled dataset.
glm-output
Output-processing guidance for GLM tasks. Especially useful after glm-basics and glm-calibration when you need verifier-matching metrics from output.nc and a final /root/metrics.json.
glm-calibration
Calibration guidance for GLM tasks. Often most effective after glm-basics has clarified the setup; glm-output is the companion skill for exact final metric computation.
glm-basics
A good starting point for GLM calibration tasks. Use to inspect glm3.nml, confirm how GLM runs, and identify the relevant files before moving on to calibration and output evaluation.