Skip to content

Commit 7008ec9

Browse files
committed
Consolidate git-sizer report and include all quantity values
1 parent 654b75b commit 7008ec9

File tree

8 files changed

+100
-81
lines changed

8 files changed

+100
-81
lines changed

docs/demo-data/repository/test-org/large-repo/git-repository-size-objects-count.tsv

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/demo-data/repository/test-org/large-repo/git-repository-size-objects-size.tsv

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
date commits commits [MiB] trees trees [MiB] tree entries blobs blobs [MiB] annotated tags refs biggest commit [KiB] most parents most tree entries biggest blob [MiB] largest history depth largest tag depth directories path depth path length files size of files [MiB] symlinks submodules
2+
2019-01-01 800564 585.22 3732337 9638.486 253108785 1330280 60880.353 0 1 72.7 66 1895 13.496 145316 0 4434 13 134 63153 774.755 40 0
3+
2019-01-02 803564 589.22 3752337 9838.486 272108785 1420280 61280.353 0 1 72.7 66 1895 13.496 145316 0 4434 13 134 63153 774.755 40 0
4+
2019-01-03 806564 595.22 3772337 9938.486 285108785 1550280 62480.353 0 1 72.7 66 1895 13.496 145316 0 4434 13 134 63153 774.755 40 0
5+
2019-01-04 809564 500.22 3792337 10038.486 290108785 1770280 63380.353 0 1 72.7 66 1895 13.496 145316 0 4434 13 134 63153 774.755 40 0
6+
2019-01-05 811564 605.22 3832337 10638.486 303108785 1830280 64880.353 0 1 72.7 66 1895 13.496 145316 0 4434 13 134 63153 774.755 40 0

docs/repository/git-repository-size.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="chart-placeholder">
88
<h3>Number of Commits, Trees, Blobs, Tags and Refs</h3>
99
<canvas
10-
data-url=".{{ site.dataURL }}/repository/git-repository-size-objects-count.tsv"
10+
data-url=".{{ site.dataURL }}/repository/git-sizer.tsv"
1111
data-type="history"
1212
data-config='{
1313
"views":
@@ -98,7 +98,7 @@ <h3>Number of Commits, Trees, Blobs, Tags and Refs</h3>
9898
<div class="chart-placeholder">
9999
<h3>Size of Commits, Trees and Blobs</h3>
100100
<canvas
101-
data-url=".{{ site.dataURL }}/repository/git-repository-size-objects-size.tsv"
101+
data-url=".{{ site.dataURL }}/repository/git-sizer.tsv"
102102
data-type="history"
103103
data-config='{
104104
"views":

updater/reports/repository/ReportGitRepositorySizeObjectsCount.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

updater/reports/repository/ReportGitRepositorySizeObjectsSize.py

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import json
2+
3+
from .ReportRepository import *
4+
5+
class ReportGitSizer(ReportRepository):
6+
def name(self):
7+
return "git-sizer"
8+
9+
def convertBytesToKiB(self, bytes):
10+
return round(bytes / 1024, 1)
11+
12+
def convertBytesToMiB(self, bytes):
13+
return round(bytes / 1024 ** 2, 3)
14+
15+
def updateData(self):
16+
stdout = self.executeScript(["ghe-repo", self.repository, "-c", self.configuration["gitSizerPath"] + " --json --json-version=2"])
17+
18+
sizerData = json.loads(stdout.decode("utf-8"))
19+
20+
getSizerDataValue = lambda key: sizerData[key]["value"]
21+
22+
self.header = \
23+
[
24+
"date",
25+
26+
# Overall repository size
27+
"commits",
28+
"commits [MiB]",
29+
"trees",
30+
"trees [MiB]",
31+
"tree entries",
32+
"blobs",
33+
"blobs [MiB]",
34+
"annotated tags",
35+
"refs",
36+
37+
# Biggest objects
38+
"biggest commit [KiB]",
39+
"most parents",
40+
"most tree entries",
41+
"biggest blob [MiB]",
42+
43+
# History structure
44+
"largest history depth",
45+
"largest tag depth",
46+
47+
# Biggest checkouts
48+
"directories",
49+
"path depth",
50+
"path length",
51+
"files",
52+
"size of files [MiB]",
53+
"symlinks",
54+
"submodules"
55+
]
56+
57+
self.data.append(
58+
[
59+
str(self.yesterday()),
60+
61+
# Overall repository size
62+
getSizerDataValue("uniqueCommitCount"),
63+
self.convertBytesToMiB(getSizerDataValue("uniqueCommitSize")),
64+
getSizerDataValue("uniqueTreeCount"),
65+
self.convertBytesToMiB(getSizerDataValue("uniqueTreeSize")),
66+
getSizerDataValue("uniqueTreeEntries"),
67+
getSizerDataValue("uniqueBlobCount"),
68+
self.convertBytesToMiB(getSizerDataValue("uniqueBlobSize")),
69+
getSizerDataValue("uniqueTagCount"),
70+
getSizerDataValue("referenceCount"),
71+
72+
# Biggest objects
73+
self.convertBytesToKiB(getSizerDataValue("maxCommitSize")),
74+
getSizerDataValue("maxCommitParentCount"),
75+
getSizerDataValue("maxTreeEntries"),
76+
self.convertBytesToMiB(getSizerDataValue("maxBlobSize")),
77+
78+
# History structure
79+
getSizerDataValue("maxHistoryDepth"),
80+
getSizerDataValue("maxTagDepth"),
81+
82+
# Biggest checkouts
83+
getSizerDataValue("maxCheckoutTreeCount"),
84+
getSizerDataValue("maxCheckoutPathDepth"),
85+
getSizerDataValue("maxCheckoutPathLength"),
86+
getSizerDataValue("maxCheckoutBlobCount"),
87+
self.convertBytesToMiB(getSizerDataValue("maxCheckoutBlobSize")),
88+
getSizerDataValue("maxCheckoutLinkCount"),
89+
getSizerDataValue("maxCheckoutSubmoduleCount")
90+
])

updater/update-stats.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636
from reports.ReportTokenlessAuth import *
3737
from reports.ReportUsers import *
3838
from reports.repository.ReportOverview import *
39-
from reports.repository.ReportGitRepositorySizeObjectsCount import *
40-
from reports.repository.ReportGitRepositorySizeObjectsSize import *
39+
from reports.repository.ReportGitSizer import *
4140
from reports.repository.ReportGitHubGitDownload import *
4241
from reports.repository.ReportGitHubApiRequestTypesByCount import *
4342

@@ -112,8 +111,7 @@ def main():
112111
# Repository reports
113112
for repository in configuration["monitoredRepositories"]:
114113
ReportOverview(configuration, dataDirectory, metaStats, repository).update()
115-
ReportGitRepositorySizeObjectsCount(configuration, dataDirectory, metaStats, repository).update()
116-
ReportGitRepositorySizeObjectsSize(configuration, dataDirectory, metaStats, repository).update()
114+
ReportGitSizer(configuration, dataDirectory, metaStats, repository).update()
117115
ReportGitHubGitDownload(configuration, dataDirectory, metaStats, repository).update()
118116
ReportGitHubApiRequestTypesByCount(configuration, dataDirectory, metaStats, repository).update()
119117

0 commit comments

Comments
 (0)