Skip to content

Commit 54a758c

Browse files
committed
stat-print / git-stat: offset overall metrics by linux-next size
Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 636c5c8 commit 54a758c

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

Diff for: README.rst

+5
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,15 @@ git stats
3434
Some statistics are much quicker to get from git. They may go away
3535
over time but for now ``git-stat.py`` loads them.
3636

37+
``next-size`` has to be found manually::
38+
39+
git log --no-merges --oneline v6.13...linux-next/master | wc -l
40+
3741
Example use::
3842

3943
./git-stat.py --db ./db.json --linux ../linux/ \
4044
--start-commit 7e68dd7d07a --end-commit 5b7c4cabbb6 \
45+
--next-size 1234 \
4146
--json-out netdev-6.4.json \
4247
--maintainers [email protected] \
4348

Diff for: git-stat.py

+3
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ def main():
165165
help="Instead of printing results add them into a JSON file")
166166
parser.add_argument('--no-ages', dest='ages', action='store_false', default=True,
167167
help="Do not print member tenure stats")
168+
parser.add_argument('--next-size', type=int, required=True,
169+
help="Number of commits in linux-next")
168170
global args
169171
args = parser.parse_args()
170172

@@ -183,6 +185,7 @@ def main():
183185
['--committer=' + x for x in args.maintainers] + \
184186
['--', 'tools/testing/selftests/']).split('\n')
185187

188+
result['next-size'] = args.next_size
186189
result['direct_commits'] = get_commit_cnt(commits)
187190
result['direct_test_commits'] = get_commit_cnt(commits_ksft)
188191
result['reviews'] = get_review_cnt(commits, args.maintainers)

Diff for: stat-print.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -274,25 +274,30 @@ def print_general(ml, key):
274274
print(f'{key}: people: {len(ml["individual"])} {rcnt}')
275275
rsum = sum(rcnt.values())
276276
for k in rcnt:
277-
rcnt[k] = round(rcnt[k] / rsum, 2)
277+
rcnt[k] = round(rcnt[k] / rsum, 3)
278278
print(f'{key}: people pct: {rcnt}')
279279
reviews = ml["git"]["reviews"]
280280
print(f'{key}: review pct: {reviews["any"]["pct"]}% x-corp pct: {reviews["x-company"]["pct"]}%')
281281
print()
282282

283283

284284
def print_diff(mlA, mlB):
285+
a = mlA["git"]["next-size"] / ml_stat_days(mlA)
286+
b = mlB["git"]["next-size"] / ml_stat_days(mlB)
287+
tree_delta = a / b
288+
print(f"Diff: {round((1/tree_delta - 1) * 100, 3):+5.1f}% linux-next size")
289+
285290
a = mlA["count"] / ml_stat_days(mlA)
286291
b = mlB["count"] / ml_stat_days(mlB)
287-
print(f'Diff: {round((b/a - 1) * 100, 3):+.1f}% msg/day')
292+
print(f'Diff: {round((b/a - 1) * 100, 3):+5.1f}% ({round((b/a*tree_delta - 1) * 100, 3):+5.1f}%) msg/day')
288293

289294
a = mlA["git"]["direct_commits"] / ml_stat_days(mlA)
290295
b = mlB["git"]["direct_commits"] / ml_stat_days(mlB)
291-
print(f'Diff: {round((b/a - 1) * 100, 3):+.1f}% commits/day')
296+
print(f'Diff: {round((b/a - 1) * 100, 3):+5.1f}% ({round((b/a*tree_delta - 1) * 100, 3):+5.1f}%) commits/day')
292297

293298
a = len(mlA["individual"]) / ml_stat_days(mlA)
294299
b = len(mlB["individual"]) / ml_stat_days(mlB)
295-
print(f'Diff: {round((b/a - 1) * 100, 3):+.1f}% people/day')
300+
print(f'Diff: {round((b/a - 1) * 100, 3):+5.1f}% ({round((b/a*tree_delta - 1) * 100, 3):+5.1f}%) people/day')
296301

297302
reviewsA = mlA["git"]["reviews"]
298303
reviewsB = mlB["git"]["reviews"]

0 commit comments

Comments
 (0)