Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Own Sphinx-Extension for GarbageCollector Stats #23

Open
danwos opened this issue Nov 10, 2022 · 0 comments
Open

Own Sphinx-Extension for GarbageCollector Stats #23

danwos opened this issue Nov 10, 2022 · 0 comments

Comments

@danwos
Copy link
Member

danwos commented Nov 10, 2022

Sphinx-Performance should also provide a Sphinx extension and maybe builder, so that we can get insights of the Sphinx-Build.

The first feature would be to collect the stats of the Garbage collector.
This code can be used:

import gc
stats = gc.get_stats()

print('** Python Garbage Collector stats **')
for index, col in enumerate(stats):
    for key, value in col.items():
        print(f'{index}.{key}: {value}')
    print('')

The output would like like this at the end of the Sphinx build:

** Python Garbage Collector stats **
0.collections: 492
0.collected: 2738
0.uncollectable: 0

1.collections: 44
1.collected: 769
1.uncollectable: 0

2.collections: 4
2.collected: 32384
2.uncollectable: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant