Skip to content

Commit cb18a4f

Browse files
Thomas StrombergThomas Stromberg
authored andcommitted
Update README
1 parent ea3e005 commit cb18a4f

File tree

1 file changed

+114
-70
lines changed

1 file changed

+114
-70
lines changed

README.md

Lines changed: 114 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,137 @@
11
# prcost
22

3-
Calculate the real-world cost of GitHub pull requests using empirically-validated software engineering research. Provides detailed breakdowns of development effort, review costs, coordination overhead, and delay impacts.
3+
Calculate the real-world cost of GitHub pull requests using empirically-validated software engineering research. Measures at a PR, repo, or organization level.
44

5-
## Hosted Web Interface
6-
7-
Try https://cost.github.codegroove.app/ - it only has access to public repositories, so if you need to take that account for accuracy, run prcost locally.
8-
9-
## CLI Example
10-
11-
```
12-
$ prcost https://github.com/chainguard-dev/apko/pull/1860
13-
14-
https://github.com/chainguard-dev/apko/pull/1860
15-
Rate: $155.71/hr • Salary: $249,000.00 • Benefits: 1.3x
16-
17-
Author
18-
──────
19-
Development Effort $7,531.93 132 LOC • 2.0 days
20-
GitHub Activity $156.25 2 sessions • 1.0 hrs
21-
GitHub Context Switching $208.33 1.3 hrs
22-
────────────
23-
Subtotal $7,896.51 2.1 days
24-
25-
Participants
26-
────────────
27-
philroche
28-
Review Activity $75.00 1 sessions • 29 min
29-
Context Switching $104.17 40 min
30-
justinvreeland
31-
Review Activity $75.00 1 sessions • 29 min
32-
Context Switching $104.17 40 min
33-
────────────
34-
Subtotal $358.33 2.3 hrs
35-
36-
Merge Delay
37-
───────────
38-
Delivery $9,481.36 2.5 days (capped)
39-
Coordination $3,160.45 20.2 hrs (capped)
40-
────────────
41-
Subtotal $12,641.81 3.4 days
42-
43-
Future Costs
44-
────────────
45-
Code Churn (18% drift) $1,155.39 7.4 hrs
46-
Review $75.00 29 min
47-
Merge $52.08 20 min
48-
Context Switching $208.33 1.3 hrs
49-
────────────
50-
Subtotal $1,490.81 9.5 hrs
5+
## Installation
516

52-
═══════════════════════════════════════════════════════════════
53-
Total $22,387.47 6.0 days
7+
Local installation, which authenticates using the GitHub command-line (`gh`) or GITHUB_TOKEN:
548

559
```
56-
57-
## Installation
58-
59-
```bash
6010
go install github.com/codeGROOVE-dev/prcost/cmd/prcost@latest
6111
```
6212

13+
Alternatively, you can use our hosted version: https://cost.github.codegroove.app/ - but it only has access to public repositories.
14+
6315
## Usage
6416

65-
```bash
66-
# Single PR analysis
67-
prcost https://github.com/owner/repo/pull/123
68-
prcost --salary 300000 https://github.com/owner/repo/pull/123
17+
CLI
6918

70-
# Repository analysis (samples 30 PRs from last 90 days)
71-
prcost --org kubernetes --repo kubernetes
72-
prcost --org myorg --repo myrepo --samples 50 --days 30
19+
```
20+
% prcost --org exera-dev
21+
22+
Analyzing 30 sampled PRs from 91 total PRs (50 human, 41 bot) across exera-dev (last 60 days)...
23+
24+
exera-dev (organization)
25+
Period: Last 60 days • Total PRs: 91 (33 human, 57 bot) • Authors: 10 • Sampled: 30
26+
Avg Open Time: 2.4w (human: 8.7h, bot: 3.7w)
27+
28+
┌─────────────────────────────────────────────────────────────┐
29+
│ Average PR (sampled over 60 day period) │
30+
└─────────────────────────────────────────────────────────────┘
31+
32+
Development Costs (33 PRs, 13 LOC)
33+
────────────────────────────────────────
34+
New Development $ 344.58 2.2h (7 LOC)
35+
Adaptation $ 20.34 7.8m (5 LOC)
36+
GitHub Activity $ 66.57 25.7m (2.6 events)
37+
Context Switching $ 27.04 10.4m (0.5 sessions)
38+
Automated Updates — 0.0m (57 PRs, 5 LOC)
39+
──────────────
40+
Subtotal $ 458.54 2.9h (56.8%)
41+
42+
Participant Costs
43+
─────────────────
44+
Review Activity $ 5.02 1.9m (0.7 reviews)
45+
GitHub Activity $ 37.18 14.3m (2.4 events)
46+
Context Switching $ 38.88 15.0m (0.8 sessions)
47+
──────────────
48+
Subtotal $ 81.07 31.3m (10.0%)
49+
50+
Delay Costs (human PRs avg 8.7h open, bot PRs avg 3.7w)
51+
───────────────────────────────────────────────────────
52+
Workstream blockage $ 98.09 37.8m (33 PRs)
53+
Automated Updates $ 126.77 48.9m (57 PRs)
54+
PR Tracking $ 35.63 13.7m (25 open PRs)
55+
──────────────
56+
Subtotal $ 260.49 1.7h (32.2%)
7357
74-
# Organization-wide analysis
75-
prcost --org chainguard-dev --samples 50 --days 60
58+
Future Costs
59+
────────────
60+
Review $ 3.64 1.4m (24 PRs)
61+
Merge $ 6.92 2.7m (24 PRs)
62+
Context Switching $ 27.04 10.4m (0.8 sessions)
63+
──────────────
64+
Subtotal $ 37.60 14.5m (4.7%)
65+
66+
Preventable Loss Total $ 260.49 1.7h (32.2%)
67+
════════════════════════════════════════════════════
68+
Average Total $ 807.86 5.2h
69+
70+
71+
┌─────────────────────────────────────────────────────────────┐
72+
│ Estimated costs within a 60 day period (extrapolated) │
73+
└─────────────────────────────────────────────────────────────┘
74+
75+
Development Costs (33 PRs, 1.2k LOC)
76+
────────────────────────────────────────
77+
New Development $ 31,356.75 8.4d (712 LOC)
78+
Adaptation $ 1,850.92 11.9h (473 LOC)
79+
GitHub Activity $ 6,058.14 38.9h (233 events)
80+
Context Switching $ 2,461.02 15.8h (48 sessions)
81+
Automated Updates — 0.0m (57 PRs, 485 LOC)
82+
──────────────
83+
Subtotal $ 41,726.82 11.2d (56.8%)
84+
85+
Participant Costs
86+
─────────────────
87+
Review Activity $ 456.61 2.9h (60 reviews)
88+
GitHub Activity $ 3,383.11 21.7h (215 events)
89+
Context Switching $ 3,537.72 22.7h (69 sessions)
90+
──────────────
91+
Subtotal $ 7,377.44 47.4h (10.0%)
92+
93+
Delay Costs (human PRs avg 8.7h open, bot PRs avg 3.7w)
94+
───────────────────────────────────────────────────────
95+
Workstream blockage $ 8,926.47 2.4d (33 PRs)
96+
Automated Updates $ 11,536.14 3.1d (57 PRs)
97+
PR Tracking $ 3,242.19 20.8h (25 open PRs)
98+
──────────────
99+
Subtotal $ 23,704.80 6.3d (32.2%)
100+
101+
Future Costs
102+
────────────
103+
Review $ 331.30 2.1h (24 PRs)
104+
Merge $ 629.42 4.0h (24 PRs)
105+
Context Switching $ 2,461.02 15.8h (72 sessions)
106+
──────────────
107+
Subtotal $ 3,421.74 22.0h (4.7%)
108+
109+
Preventable Loss Total $ 23,704.80 6.3d (32.2%)
110+
════════════════════════════════════════════════════
111+
Total $ 73,515.44 2.8w
112+
113+
┌─────────────────────────────────────────────────────────────┐
114+
│ DEVELOPMENT EFFICIENCY: D (67.8%) - Not good my friend. │
115+
└─────────────────────────────────────────────────────────────┘
116+
┌─────────────────────────────────────────────────────────────┐
117+
│ MERGE VELOCITY: F (2.4w) - Failing │
118+
└─────────────────────────────────────────────────────────────┘
119+
Weekly waste per PR author: $ 276.56 1.8h (10 authors)
120+
If Sustained for 1 Year: $ 144,204.17 0.4 headcount
121+
122+
┌─────────────────────────────────────────────────────────────┐
123+
│ MERGE TIME MODELING │
124+
└─────────────────────────────────────────────────────────────┘
125+
If you lowered your average merge time to 1.0h, you would save
126+
~$126,616.08/yr in engineering overhead (+28.4% throughput).
76127
```
77128

78-
### Web Interface
129+
Web interface:
79130

80131
```bash
81132
go run ./cmd/server
82133
```
83134

84-
### Sampling Strategy
85-
86-
Repository and organization modes use time-bucket sampling to ensure even distribution across the time period, avoiding temporal clustering that would bias estimates.
87-
88-
- **30 samples** (default): Fast analysis with ±18% confidence interval
89-
- **50 samples**: More accurate with ±14% confidence interval (1.3× better precision)
90-
91135
## Cost Model: Scientific Foundations
92136

93137
This model synthesizes empirical research from software engineering economics, cognitive psychology, and organizational behavior. Individual PR estimates exhibit variance due to developer heterogeneity; statistical validity improves with aggregate analysis (n ≥ 25).

0 commit comments

Comments
 (0)