MCPcopy
hub / github.com/github/git-sizer / recordTree

Method recordTree

sizes/sizes.go:237–268  ·  view source on GitHub ↗
(
	g *Graph, oid git.OID, treeSize TreeSize, size counts.Count32, treeEntries counts.Count32,
)

Source from the content-addressed store, hash-verified

235}
236
237func (s *HistorySize) recordTree(
238 g *Graph, oid git.OID, treeSize TreeSize, size counts.Count32, treeEntries counts.Count32,
239) {
240 s.UniqueTreeCount.Increment(1)
241 s.UniqueTreeSize.Increment(counts.Count64(size))
242 s.UniqueTreeEntries.Increment(counts.Count64(treeEntries))
243 if s.MaxTreeEntries.AdjustMaxIfNecessary(treeEntries) {
244 setPath(g.pathResolver, &s.MaxTreeEntriesTree, oid, "tree")
245 }
246
247 if s.MaxPathDepth.AdjustMaxIfNecessary(treeSize.MaxPathDepth) {
248 setPath(g.pathResolver, &s.MaxPathDepthTree, oid, "tree")
249 }
250 if s.MaxPathLength.AdjustMaxIfNecessary(treeSize.MaxPathLength) {
251 setPath(g.pathResolver, &s.MaxPathLengthTree, oid, "tree")
252 }
253 if s.MaxExpandedTreeCount.AdjustMaxIfNecessary(treeSize.ExpandedTreeCount) {
254 setPath(g.pathResolver, &s.MaxExpandedTreeCountTree, oid, "tree")
255 }
256 if s.MaxExpandedBlobCount.AdjustMaxIfNecessary(treeSize.ExpandedBlobCount) {
257 setPath(g.pathResolver, &s.MaxExpandedBlobCountTree, oid, "tree")
258 }
259 if s.MaxExpandedBlobSize.AdjustMaxIfNecessary(treeSize.ExpandedBlobSize) {
260 setPath(g.pathResolver, &s.MaxExpandedBlobSizeTree, oid, "tree")
261 }
262 if s.MaxExpandedLinkCount.AdjustMaxIfNecessary(treeSize.ExpandedLinkCount) {
263 setPath(g.pathResolver, &s.MaxExpandedLinkCountTree, oid, "tree")
264 }
265 if s.MaxExpandedSubmoduleCount.AdjustMaxIfNecessary(treeSize.ExpandedSubmoduleCount) {
266 setPath(g.pathResolver, &s.MaxExpandedSubmoduleCountTree, oid, "tree")
267 }
268}
269
270func (s *HistorySize) recordCommit(
271 g *Graph, oid git.OID, commitSize CommitSize,

Callers 1

finalizeTreeSizeMethod · 0.80

Calls 4

Count64TypeAlias · 0.92
setPathFunction · 0.85
IncrementMethod · 0.45
AdjustMaxIfNecessaryMethod · 0.45

Tested by

no test coverage detected