MCPcopy Index your code
hub / github.com/python/cpython / get_gc_stats

Method get_gc_stats

Tools/scripts/summarize_stats.py:440–451  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

438 return result
439
440 def get_gc_stats(self) -> list[dict[str, int]]:
441 gc_stats: list[dict[str, int]] = []
442 for key, value in self._data.items():
443 if not key.startswith("GC"):
444 continue
445 n, _, rest = key[3:].partition("]")
446 name = rest.strip()
447 gen_n = int(n)
448 while len(gc_stats) <= gen_n:
449 gc_stats.append({})
450 gc_stats[gen_n][name] = value
451 return gc_stats
452
453 def get_optimization_stats(self) -> dict[str, tuple[int, int | None]]:
454 if "Optimization attempts" not in self._data:

Callers 1

calc_gc_statsFunction · 0.80

Calls 5

itemsMethod · 0.45
startswithMethod · 0.45
partitionMethod · 0.45
stripMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected